Giter VIP home page Giter VIP logo

Comments (3)

ursenzler avatar ursenzler commented on May 18, 2024

Take a look at this test (https://github.com/appccelerate/statemachine/blob/master/source/Appccelerate.StateMachine.Specs/Async/Transitions.cs), it shows how the state machine can be used.

And here (http://www.appccelerate.com/statemachinesample.html) you find some explanations.

You can fire an event inside an OnEntry function, but I guess there would be a better state machine design that models the states better. A state that is left immediately is normally not a state, but part of a transition.

There are two flavours of the state machine: passive and active. The passive state machine executes a transition whenever you call Fire on it and will block the caller until it is finished. The active state machine has an internal thread that will execute the transition, the caller is not blocked.
So you simply need to hold the instance of the state machine and make Firecalls (don't forget to first Initialize and then Start).

Let me know if this helps, otherwise I'll add a sample project to the solution.

from statemachine.

luckielordie avatar luckielordie commented on May 18, 2024

Thanks for the swift reply! I'll have some time later on today to have a look at this.

I appreciate this is probably my naivety of the language, I'm seeing a lot of 'await' In the code sample that I have yet to learn fully. Thanks for your patience.

from statemachine.

ursenzler avatar ursenzler commented on May 18, 2024

from statemachine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.