Add terminal states to TKStateMachine.#15
Conversation
There was a problem hiding this comment.
Should probably be isTerminated
There was a problem hiding this comment.
I don't feel strongly. I deliberated
this a bit myself, but I felt like if it wasn't just "terminated" that it
should really be "hasTerminated" but that doesn't really go with the naming
convention. I guess terminated isn't a great word... maybe finished would
be better... shrug
|
What's the use case on this? |
|
I was trying to come up with a way of nesting state machines. Specifically, |
There was a problem hiding this comment.
Shouldn't this be TKStateMachineDidTerminateNotification ?
|
I did some more thinking on this: Couldn't the
that introspects the transitions from the state to determine if it is indeed terminal. From there, we can emit the terminated error by evaluating if I would probably also add the |
|
This wouldn't work in the face of events with |
|
I wonder if this doesn't argue for eliminating the support for |
|
I would like to revive this terminal state work for TransitionKit 3.0 by removing support for |
|
The idea of nested machines is a good one and I would love to revive this conversation, unless there's something easy I'm missing to accomplish that another way. @blakewatters, is this something you're still considering? |
This patch adds the ability to specify terminal states for the machine. Once the machine transitions into a terminal state it will refuse to fire any more events. Patch also includes assorted other fixes (like eliminating the use of property setters in -init and transitioning off of shouldBeNil/shouldNotBeNil which are deprecated in Kiwi).