You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The natural way to build abstractions in Go is to use higher order functions instead of OOP style classes-like structs and interfaces (the latter of course have their place but more for the consumer than producer side)
So, e.g. instead of implementing a "class" (struct) per state you could have something like this
var sm iwf.StaMa[StateType] := iwf.NewStaMa("sm-id", initialState, iwf.WithPersistanceOptions(...))
sm.AddState("state-id-1", func(...) {
// some logic
return "the-next-state"
}, iwf.WithSomeOption(...))
The text was updated successfully, but these errors were encountered:
This is a comment/idea from a Temporal user:
The natural way to build abstractions in Go is to use higher order functions instead of OOP style classes-like structs and interfaces (the latter of course have their place but more for the consumer than producer side)
So, e.g. instead of implementing a "class" (struct) per state you could have something like this
The text was updated successfully, but these errors were encountered: