File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ import {
2525} from "./types/errors.js" ;
2626import { CompletablePromise } from "./utils/completable_promise.js" ;
2727import type { ContextImpl , RunClosuresTracker } from "./context_impl.js" ;
28- import { setTimeout } from "node:timers/promises" ;
28+ import { setImmediate } from "node:timers/promises" ;
2929import type { InputPump , OutputPump } from "./io.js" ;
3030import type { Duration } from "@restatedev/restate-sdk-core" ;
3131
@@ -415,7 +415,7 @@ export class PromisesExecutor {
415415 // The reason for this setTimeout is that we need to enqueue the polling after
416416 // we eventually resolve some promises. This is especially crucial for RestateCombinatorPromise
417417 // as it flips the completed state using .finally() on the combinator.
418- return setTimeout ( ) . then ( async ( ) => {
418+ return setImmediate ( ) . then ( async ( ) => {
419419 try {
420420 // Invoke do progress on the vm
421421 const handles = restatePromise . uncompletedLeaves ( ) ;
@@ -442,7 +442,7 @@ export class PromisesExecutor {
442442 // We need to execute a run closure
443443 this . runClosuresTracker . executeRun ( doProgressResult . ExecuteRun ) ;
444444 // Let the run context switch, then come back to this flow.
445- await setTimeout ( ) ;
445+ await setImmediate ( ) ;
446446 }
447447
448448 // Recursion
You can’t perform that action at this time.
0 commit comments