fixed buffers to wrap channel.send_exception with spawn, so that it doesn't block the mainloop
This commit is contained in:
@@ -29,7 +29,7 @@ class Protocol(twistedProtocol):
|
|||||||
spawn(self.channel.send, data)
|
spawn(self.channel.send, data)
|
||||||
|
|
||||||
def connectionLost(self, reason):
|
def connectionLost(self, reason):
|
||||||
self.channel.send_exception(reason.value)
|
spawn(self.channel.send_exception, reason.value)
|
||||||
self.channel = None # QQQ channel creates a greenlet. does it actually finish and memory is reclaimed?
|
self.channel = None # QQQ channel creates a greenlet. does it actually finish and memory is reclaimed?
|
||||||
|
|
||||||
|
|
||||||
|
@@ -9,7 +9,7 @@ class LineOnlyReceiver(basic.LineOnlyReceiver):
|
|||||||
spawn(self.channel.send, line)
|
spawn(self.channel.send, line)
|
||||||
|
|
||||||
def connectionLost(self, reason):
|
def connectionLost(self, reason):
|
||||||
self.channel.send_exception(reason.value)
|
spawn(self.channel.send_exception, reason.value)
|
||||||
|
|
||||||
class LineOnlyReceiverBuffer(BaseBuffer):
|
class LineOnlyReceiverBuffer(BaseBuffer):
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user