coros: reenable sleep() in Channel.send() to give earlier senders/waiters a priority

This commit is contained in:
Denis Bilenko
2009-06-22 16:34:53 +07:00
parent 85bc52d0e6
commit 3b483168b4

View File

@@ -508,8 +508,8 @@ class Channel(object):
if self._waiters:
api.get_hub().schedule_call_global(0, self._do_switch)
else:
# if self._waiters and self._senders:
# api.sleep(0)
if self._waiters and self._senders:
api.sleep(0)
self.items.append((result, exc))
# note that send() does not work well with timeouts. if your timeout fires
# after this point, the item will remain in the queue