Skip to content

Commit d6bf132

Browse files
author
Sean Trott
committed
2 parents aaf614f + 9cce9f0 commit d6bf132

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

src/main/nluas/Transport.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,13 @@ def get_callback(tup, **kw):
203203

204204
def quit_federation(self):
205205
'''Send a quit message to all agents in this federation, and then close down the Transport.'''
206-
self._pyre.shouts(self._globalchannel, u"QUIT")
207-
self._run = False
208-
# Wait for the readthread to finish
209-
self._readthread.join()
210-
# Tell Pyre to shut down
211-
self._pyre.stop()
206+
if self._run:
207+
self._pyre.shouts(self._globalchannel, u"QUIT")
208+
self._run = False
209+
# Wait for the readthread to finish
210+
self._readthread.join()
211+
# Tell Pyre to shut down
212+
self._pyre.stop()
212213

213214
def is_running(self):
214215
'''Return the status of this Transport. If the Transport isn't running, you should not send it messages and the callbacks will not be called.'''
@@ -381,8 +382,4 @@ def _EXIT(self, sid, name):
381382
myname = sys.argv[1]
382383
remotename = sys.argv[2]
383384

384-
t = Transport(myname)
385-
t.subscribe(remotename, lambda tuple: print('Got', tuple))
386-
387-
while True:
388-
t.send(remotename, input())
385+
t = Trans

0 commit comments

Comments
 (0)