tweaks
This commit is contained in:
parent
35324a7911
commit
17a90d87ac
|
@ -133,6 +133,11 @@ class Machine:
|
||||||
format_attrs(**t._dot_attrs())))
|
format_attrs(**t._dot_attrs())))
|
||||||
f.write("}\n")
|
f.write("}\n")
|
||||||
|
|
||||||
|
# all descriptions are from the state machine's point of view
|
||||||
|
# States are gerunds: Foo-ing
|
||||||
|
# Events are past-tense verbs: Foo-ed, as in "I have been Foo-ed"
|
||||||
|
# * machine.do(event) ? vs machine.fooed()
|
||||||
|
# Actions are immediate-tense verbs: foo, connect
|
||||||
|
|
||||||
def State(self, name, initial=False, **dot_attrs):
|
def State(self, name, initial=False, **dot_attrs):
|
||||||
s = _State(self, name, dot_attrs)
|
s = _State(self, name, dot_attrs)
|
||||||
|
@ -260,6 +265,7 @@ class ConnectionMachine:
|
||||||
waiting.upon(expire, goto=reconnect, color="blue")
|
waiting.upon(expire, goto=reconnect, color="blue")
|
||||||
waiting.upon(stop, goto=cancel_timer)
|
waiting.upon(stop, goto=cancel_timer)
|
||||||
reconnecting.upon(d_callback, goto=reset_timer, color="blue")
|
reconnecting.upon(d_callback, goto=reset_timer, color="blue")
|
||||||
|
reconnecting.upon(d_errback, goto=start_timer)
|
||||||
reconnecting.upon(stop, goto=d_cancel)
|
reconnecting.upon(stop, goto=d_cancel)
|
||||||
disconnecting.upon(onClose, goto=MC_stopped, color="orange")
|
disconnecting.upon(onClose, goto=MC_stopped, color="orange")
|
||||||
cancelling.upon(d_errback, goto=MC_stopped)
|
cancelling.upon(d_errback, goto=MC_stopped)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user