##// END OF EJS Templates
Channels can no longer be restarted.
Brian Granger -
Show More
@@ -45,13 +45,12 b' class ZmqSocketChannel(Thread):'
45
45
46 def stop(self):
46 def stop(self):
47 """ Stop the thread's activity. Returns when the thread terminates.
47 """Stop the thread's activity. Returns when the thread terminates.
48
49 The thread will raise :class:`RuntimeError` if :method:`self.start`
50 is called again.
48 """
51 """
49 self.join()
52 self.join()
50
53
51 # Allow the thread to be started again.
52 # FIXME: Although this works (and there's no reason why it shouldn't),
53 # it feels wrong. Is there a cleaner way to achieve this?
54 Thread.__init__(self)
55
54
56 def get_address(self):
55 def get_address(self):
57 """ Get the channel's address. By the default, a channel is on
56 """ Get the channel's address. By the default, a channel is on
@@ -65,7 +64,7 b' class ZmqSocketChannel(Thread):'
65 or None, in which case the address is reset to its default value.
64 or None, in which case the address is reset to its default value.
66 """
65 """
67 # FIXME: Validate address.
66 # FIXME: Validate address.
68 if self.is_alive():
67 if self.is_alive(): # This is Thread.is_alive
69 raise RuntimeError("Cannot set address on a running channel!")
68 raise RuntimeError("Cannot set address on a running channel!")
70 else:
69 else:
71 if address is None:
70 if address is None:
General Comments 0
You need to be logged in to leave comments. Login now