From 17a90d87acb26c5f36729d8d24ef31a724116ab5 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Wed, 28 Dec 2016 16:44:48 -0500 Subject: [PATCH] tweaks --- src/wormhole/_c2.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/wormhole/_c2.py b/src/wormhole/_c2.py index 5fd2519..b1eb720 100644 --- a/src/wormhole/_c2.py +++ b/src/wormhole/_c2.py @@ -133,6 +133,11 @@ class Machine: format_attrs(**t._dot_attrs()))) 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): s = _State(self, name, dot_attrs) @@ -260,6 +265,7 @@ class ConnectionMachine: waiting.upon(expire, goto=reconnect, color="blue") waiting.upon(stop, goto=cancel_timer) reconnecting.upon(d_callback, goto=reset_timer, color="blue") + reconnecting.upon(d_errback, goto=start_timer) reconnecting.upon(stop, goto=d_cancel) disconnecting.upon(onClose, goto=MC_stopped, color="orange") cancelling.upon(d_errback, goto=MC_stopped)