Schedule a method-name callback on the virtual executor after a delay. Used by WS transpile output to replace TS `this.delay(ms, "name", ...args)`. Method params are effectively final so this avoids lambda-capture errors an inline spawn rewrite would hit with reassignable locals.
(Object delayMs, String methodName, Object... args)
| 1842 | * an inline spawn rewrite would hit with reassignable locals. |
| 1843 | */ |
| 1844 | public void scheduleCallback(Object delayMs, String methodName, Object... args) { |
| 1845 | this.spawn(() -> { |
| 1846 | try { |
| 1847 | Thread.sleep(((Number) delayMs).longValue()); |
| 1848 | Helpers.callDynamically(this, methodName, args); |
| 1849 | } catch (Exception ignored) { |
| 1850 | } |
| 1851 | }); |
| 1852 | } |
| 1853 | |
| 1854 | /** |
| 1855 | * Start an async method-name call on the virtual executor and return a |
no test coverage detected