diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-04-14 11:20:02 +0300 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-04-14 11:20:02 +0300 |
commit | 0baae51e217f4999c1f068c458527d598284ddec (patch) | |
tree | 6b13cf44af03a1870fb730a3fa4825fc552df397 /distbuild/initiator_connection.py | |
parent | 63f7346990802f01ef76cba75495f6f7d1409028 (diff) | |
parent | f05022d39b530069a75fbecfd744bca66cc0ce66 (diff) | |
download | morph-0baae51e217f4999c1f068c458527d598284ddec.tar.gz |
Merge branch 'sam/distbuild-concurrency-fixes'
Reviewed-By: Lars Wirzenius <lars.wirzenius@codethink.co.uk>
Diffstat (limited to 'distbuild/initiator_connection.py')
-rw-r--r-- | distbuild/initiator_connection.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/distbuild/initiator_connection.py b/distbuild/initiator_connection.py index d48d4698..e20e6d98 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. @@ -64,6 +67,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), @@ -99,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): |