Giter Site home page Giter Site logo

Comments (4)

itsprdp avatar itsprdp commented on August 25, 2024 1

This is a known issue and @annismckenzie has put together a nice PR #82 which is yet to be merged.

Hackish solution that might work for you:

func (p *ClusterState) unreachableLogic() {
  timeLimit := p.CreatedAt.Add(time.Minute * 30)
  if timeLimit.Before(p.Clock.Now()) {
    e.FSM.SetState("CREATING") // it hangs here
  }

}

func (p *ClusterState) beforeCreating(e *fsm.Event) {
  p.Logger.Infof("Triggered event %v, trying to reach status %s", e.Event, e.Dst)

  if p.Unreachable {
    go p.unreachableLogic()
  }
}

from fsm.

lzecca78 avatar lzecca78 commented on August 25, 2024 1

thanks for your help @itsprdp, I ended up with a solution that uses heavily the Metadata and GetMetadata feature and then a big switch case for a call to a transition to the desired state. Is of course sub-optimal, but unless the branch will not be merged, it is working. After the fix, I will revisit it. Thanks again for your help, really appreciated it!

from fsm.

lzecca78 avatar lzecca78 commented on August 25, 2024

The same happens if I try to trigger an FSM.Event instead of SetState

from fsm.

annismckenzie avatar annismckenzie commented on August 25, 2024

#88 was merged today and you may want to revisit this. 🙃

from fsm.

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.