org.springframework.statemachine.support.StateMachineExecutor.MonoSinkStateMachineExecutorCallback implementation seems to be wrong when trying to bridge callback API to Mono.
The callback bridge implementation should look similar to this one:
Callback<String> callback = new Callback<String>() {
@Override
public void onResult(String data) {
sink.success(data.toLowerCase());
}
@Override
public void onError(Exception e) {
sink.error(e);
}
}
However, the current implementation publishes event whenever there is a demand, regardless of the callback being actually called - please note the final else case:
@Override
public void accept(MonoSink<Void> t) {
if (complete) {
t.success();
} else if (error != null) {
t.error(error);
} else {
t.success();
}
}
With the current implementation, there is no way to wait for the transitions to complete after sending an event via org.springframework.statemachine.StateMachineEventResult#complete Mono. The Mono completes immediately after subscription.
org.springframework.statemachine.support.StateMachineExecutor.MonoSinkStateMachineExecutorCallback
implementation seems to be wrong when trying to bridge callback API to Mono.The callback bridge implementation should look similar to this one:
However, the current implementation publishes event whenever there is a demand, regardless of the callback being actually called - please note the final else case:
With the current implementation, there is no way to wait for the transitions to complete after sending an event via
org.springframework.statemachine.StateMachineEventResult#complete
Mono. The Mono completes immediately after subscription.