StateMachine icon indicating copy to clipboard operation
StateMachine copied to clipboard

Adding support for suspend functions

Open bruuuuuuuce opened this issue 3 years ago • 1 comments

Wanted to say thanks for developing this state machine library! Are there plans in the future to add support for calling suspending functions from within the handlers? Right now to workaround this we need to do something like

state<State.MyState> {
  on<Event.MyEvent> {
    runBlocking {
      mySuspendingFunction()
    }
  }
}

Would be nice to just be able to call mySuspendingFunction() from directly within the event handler.

Also, is the version 0.3.0 going to be published to maven? It looks like the most recent version on maven is 0.2.0 https://mvnrepository.com/artifact/com.tinder.statemachine/statemachine.

bruuuuuuuce avatar May 06 '22 20:05 bruuuuuuuce

Thanks, @bruuuuuuuce. Interesting idea.

Could you provide an example of a use case for this?

tinder-tramesh avatar Jan 27 '23 23:01 tinder-tramesh