File tree Expand file tree Collapse file tree 3 files changed +5
-7
lines changed
sdk-core/src/main/java/dev/restate/sdk/core Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -416,10 +416,8 @@ private void pollAsyncResultInner(AsyncResultInternal<?> asyncResult) {
416416 } else if (response instanceof StateMachine .DoProgressResponse .ReadFromInput
417417 || response instanceof StateMachine .DoProgressResponse .WaitingPendingRun ) {
418418 this .stateMachine .onNextEvent (
419- () -> {
420- LOG .info ("Triggered after wait {}" , response );
421- this .pollAsyncResultInner (asyncResult );
422- });
419+ () -> this .pollAsyncResultInner (asyncResult ),
420+ response instanceof StateMachine .DoProgressResponse .ReadFromInput );
423421 return ;
424422 } else if (response instanceof StateMachine .DoProgressResponse .ExecuteRun ) {
425423 triggerScheduledRun (((StateMachine .DoProgressResponse .ExecuteRun ) response ).handle ());
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ static StateMachine init(
4444
4545 // --- Await next event
4646
47- void onNextEvent (Runnable runnable );
47+ void onNextEvent (Runnable runnable , boolean triggerNowIfInputClosed );
4848
4949 // --- Async results
5050
Original file line number Diff line number Diff line change @@ -73,14 +73,14 @@ public CompletableFuture<Void> waitForReady() {
7373 }
7474
7575 @ Override
76- public void onNextEvent (Runnable runnable ) {
76+ public void onNextEvent (Runnable runnable , boolean triggerNowIfInputClosed ) {
7777 this .nextEventListener =
7878 () -> {
7979 this .nextEventListener .run ();
8080 runnable .run ();
8181 };
8282 // Trigger this now
83- if (this .stateContext .isInputClosed ()) {
83+ if (triggerNowIfInputClosed && this .stateContext .isInputClosed ()) {
8484 this .triggerNextEventSignal ();
8585 }
8686 }
You can’t perform that action at this time.
0 commit comments