cothread.coselect
index
/dls_sw/prod/common/python/cothread/1-14/cothread/coselect.py

Support for cooperative select functions.  Replaces the functionality of
the standard select module.

 
Modules
       
select
cothread.cothread
ctypes
platform
time

 
Classes
       
__builtin__.object
poll
exceptions.Exception
SelectError

 
class SelectError(exceptions.Exception)
     Methods defined here:
__init__(self, flags)
__str__(self)

Methods inherited from exceptions.Exception:
__getitem__(...)

 
class poll(__builtin__.object)
    Emulates select.poll(), but implements a cooperative non-blocking
version for use with the cothread library.
 
  Methods defined here:
__init__(self)
poll(self, timeout=None)
Blocks until any of the registered file events become ready.
 
Beware: the timeout here is in milliseconds.  This is consistent
with the select.poll().poll() function which this is emulating, 
but inconsistent with all the other cothread routines!
 
Consider using poll_list() instead for polling.
register(self, file, events=7)
Adds file to the list of objects to be polled.  The default set
of events is POLLIN|POLLPRI|POLLOUT.
unregister(self, file)
Removes file from the polling list.

Data and other attributes defined here:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'poll' objects>
list of weak references to the object (if defined)

 
Functions
       
poll_block = poll_block_poll(poll_list, timeout=None)
A simple wrapper for the poll method to provide actually directly
useful functionality.  This will block non-cooperatively, so should only
be used in a scheduler loop.
    Note that the timeout is in seconds.
poll_list(event_list, timeout=None)
event_list is a list of pairs, each consisting of a waitable
descriptor and an event mask (generated by oring together POLL...
constants).  This routine will cooperatively block until any descriptor
signals a selected event (or any event from HUP, ERR, NVAL) or until
the timeout (in seconds) occurs.
select(iwtd, owtd, ewtd, timeout=None)
Non blocking select() function.  The interface should be as for the
standard library select.select() function (though it raises different
exceptions).

 
Data
        POLLERR = 8
POLLEXTRA = 56
POLLHUP = 16
POLLIN = 1
POLLMSG = 1024
POLLNVAL = 32
POLLOUT = 4
POLLPRI = 2
POLLRDBAND = 128
POLLRDNORM = 64
POLLWRBAND = 512
POLLWRNORM = 256
__all__ = ['select', 'poll', 'poll_list', 'poll_block', 'SelectError', 'POLLIN', 'POLLPRI', 'POLLOUT', 'POLLERR', 'POLLHUP', 'POLLNVAL', 'POLLEXTRA', 'POLLRDNORM', 'POLLRDBAND', 'POLLWRNORM', 'POLLWRBAND', 'POLLMSG']