Auto advancing state machine with Stateless

后端 未结 1 1213
失恋的感觉
失恋的感觉 2021-01-02 15:33

I\'ve been experimenting with Stateless (HSM in C#) (https://code.google.com/p/stateless/) lately and I\'ve come across something that I\'m not really sure how to achieve.

相关标签:
1条回答
  • 2021-01-02 16:20

    Given that I found no native solution on Stateless to do what I asked, I ended up wrapping the .Fire(trigger) in a task

    Task.Start(() => _stateMachine.Fire(trigger));
    

    Doing so, means that the state machine does not advance itself per say, but it's rather advanced by an external source, solving the SO exception.

    0 讨论(0)
提交回复
热议问题