plug_idle can have readable and writable False

in this case we wait only for close events
This commit is contained in:
Dimitur Kirov 2006-02-12 02:23:20 +00:00
parent 7576bb4f3e
commit f84e410e5b
1 changed files with 7 additions and 4 deletions

View File

@ -97,12 +97,15 @@ class IdleQueue:
self.queue[obj.fd] = obj self.queue[obj.fd] = obj
if writable: if writable:
if not readable: if not readable:
flags = 4 # read only flags = 20 # write only
else: else:
flags = 7 # both readable and writable flags = 23 # both readable and writable
else: else:
flags = 3 # write only if readable:
flags |= 16 # hung up, closed channel flags = 19 # read only
else:
# when we paused a FT, we expect only a close event
flags = 16
self.add_idle(obj.fd, flags) self.add_idle(obj.fd, flags)
def add_idle(self, fd, flags): def add_idle(self, fd, flags):