Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass client to _child factory in BehavorialFsm #133

Closed
colegleason opened this issue Nov 7, 2016 · 1 comment
Closed

Pass client to _child factory in BehavorialFsm #133

colegleason opened this issue Nov 7, 2016 · 1 comment

Comments

@colegleason
Copy link

I'm trying to have a hierarchical BehavorialFsm where the general behavior is captured in the parent and some client specific behavior is captured in the child. To do that, I need the client to be accessible to the _child factory function when the Fsm tries to fetch it. Is that possible?

@ifandelse
Copy link
Owner

@colegleason Many apologies for the long silence here (see #146). Here's what I'd recommend for now - and if this doesn't work, we can revisit in a new issue (also I'm assuming the factory needs access to the client b/c of needing it in the initialization behavior of the child FSM?): Try to keep that child FSM as client-state-agnostic as possible, and instead move whatever init behavior that needs the client into a initial state of that child FSM and act on the client there. The reasoning here is that the construction of a BehavioralFsm (whether creating the initial instances, or the init that happens as the parent/children transition to new states) is low-level concern of the lib that shouldn't depend directly on client state being fed to the FSM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants