From 569d157449266cc3588af75dc44f81b2d3b0fb13 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Sat, 9 Sep 2017 20:41:42 +0530 Subject: [PATCH] Remove special case for Waker construction --- econtext/core.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/econtext/core.py b/econtext/core.py index 71c9b902..0e78d1cd 100644 --- a/econtext/core.py +++ b/econtext/core.py @@ -668,7 +668,6 @@ class Waker(BasicStream): set_cloexec(wfd) self.receive_side = Side(self, rfd) self.transmit_side = Side(self, wfd) - broker.start_receive(self) def __repr__(self): return 'Waker(%r)' % (self._broker,) @@ -878,6 +877,7 @@ class Broker(object): self._readers = set() self._writers = set() self._waker = Waker(self) + self.start_receive(self._waker) self._thread = threading.Thread(target=self._broker_main, name='econtext-broker') self._thread.start() @@ -887,8 +887,7 @@ class Broker(object): func(*args, **kwargs) else: self._queue.put((func, args, kwargs)) - if self._waker: - self._waker.wake() + self._waker.wake() def start_receive(self, stream): """Mark the :py:attr:`receive_side ` on `stream` as