From 7b78e37eae3d9a570175ca6c824a3af6c0802b83 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Wed, 9 Apr 2014 12:28:14 +0000 Subject: distbuild: Label state machine transition tables Makes it easier to see what they mean at a glance. --- distbuild/initiator_connection.py | 1 + 1 file changed, 1 insertion(+) (limited to 'distbuild/initiator_connection.py') diff --git a/distbuild/initiator_connection.py b/distbuild/initiator_connection.py index d48d4698..bdce55e4 100644 --- a/distbuild/initiator_connection.py +++ b/distbuild/initiator_connection.py @@ -64,6 +64,7 @@ class InitiatorConnection(distbuild.StateMachine): self.our_ids = set() spec = [ + # state, source, event_class, new_state, callback ('idle', self.jm, distbuild.JsonNewMessage, 'idle', self._handle_msg), ('idle', self.jm, distbuild.JsonEof, 'closing', self._disconnect), -- cgit v1.2.1 From 5636a47c71bb063f351583a98064892f225f9be4 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Wed, 9 Apr 2014 13:55:32 +0000 Subject: distbuild: Clarify InitiatorConnection docstring --- distbuild/initiator_connection.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'distbuild/initiator_connection.py') diff --git a/distbuild/initiator_connection.py b/distbuild/initiator_connection.py index bdce55e4..31f89479 100644 --- a/distbuild/initiator_connection.py +++ b/distbuild/initiator_connection.py @@ -35,9 +35,12 @@ class _Close(object): class InitiatorConnection(distbuild.StateMachine): - '''Communicate with the initiator. - - This state machine communicates with the initiator, relaying and + '''Communicate with a single initiator. + + When a developer runs 'morph distbuild' and connects to the controller, + the ListenServer object on the controller creates an InitiatorConnection. + + This state machine communicates with the build initiator, relaying and translating messages from the initiator to the rest of the controller's state machines, and vice versa. -- cgit v1.2.1 From 426c9ea359689103de8c0ff6a7dccc6922d78cf8 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Thu, 10 Apr 2014 08:04:13 +0000 Subject: distbuild: Make some transitions more specific There is always one BuildController object per InitiatorConnection. By coupling the objects slightly closer we can simplify some transitions in BuildController. --- distbuild/initiator_connection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'distbuild/initiator_connection.py') diff --git a/distbuild/initiator_connection.py b/distbuild/initiator_connection.py index 31f89479..e20e6d98 100644 --- a/distbuild/initiator_connection.py +++ b/distbuild/initiator_connection.py @@ -103,7 +103,7 @@ class InitiatorConnection(distbuild.StateMachine): self._route_map.add(event.msg['id'], new_id) event.msg['id'] = new_id build_controller = distbuild.BuildController( - event.msg, self.artifact_cache_server, self.morph_instance) + self, event.msg, self.artifact_cache_server, self.morph_instance) self.mainloop.add_state_machine(build_controller) def _disconnect(self, event_source, event): -- cgit v1.2.1