select
index
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/select.so
Module Docs

This module supports asynchronous I/O on multiple file descriptors.
 
*** IMPORTANT NOTICE ***
On Windows and OpenVMS, only sockets are supported; on Unix, all file descriptors.

 
Classes
       
__builtin__.object
kevent
kqueue
exceptions.Exception(exceptions.BaseException)
error

 
class error(exceptions.Exception)
    
Method resolution order:
error
exceptions.Exception
exceptions.BaseException
__builtin__.object

Data descriptors defined here:
__weakref__
list of weak references to the object (if defined)

Methods inherited from exceptions.Exception:
__init__(...)
x.__init__(...) initializes x; see help(type(x)) for signature

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__str__(...)
x.__str__() <==> str(x)
__unicode__(...)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message

 
class kevent(__builtin__.object)
    kevent(ident, filter=KQ_FILTER_READ, flags=KQ_EV_ADD, fflags=0, data=0, udata=0)
 
This object is the equivalent of the struct kevent for the C API.
 
See the kqueue manpage for more detailed information about the meaning
of the arguments.
 
One minor note: while you might hope that udata could store a
reference to a python object, it cannot, because it is impossible to
keep a proper reference count of the object once it's passed into the
kernel. Therefore, I have restricted it to only storing an integer.  I
recommend ignoring it and simply using the 'ident' field to key off
of. You could also set up a dictionary on the python side to store a
udata->object mapping.
 
  Methods defined here:
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__gt__(...)
x.__gt__(y) <==> x>y
__init__(...)
x.__init__(...) initializes x; see help(type(x)) for signature
__le__(...)
x.__le__(y) <==> x<=y
__lt__(...)
x.__lt__(y) <==> x<y
__ne__(...)
x.__ne__(y) <==> x!=y
__repr__(...)
x.__repr__() <==> repr(x)

Data descriptors defined here:
data
fflags
filter
flags
ident
udata

Data and other attributes defined here:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

 
class kqueue(__builtin__.object)
    Kqueue syscall wrapper.
 
For example, to start watching a socket for input:
>>> kq = kqueue()
>>> sock = socket()
>>> sock.connect((host, port))
>>> kq.control([kevent(sock, KQ_FILTER_WRITE, KQ_EV_ADD)], 0)
 
To wait one second for it to become writeable:
>>> kq.control(None, 1, 1000)
 
To stop listening:
>>> kq.control([kevent(sock, KQ_FILTER_WRITE, KQ_EV_DELETE)], 0)
 
  Methods defined here:
close(...)
close() -> None
 
Close the kqueue control file descriptor. Further operations on the kqueue
object will raise an exception.
control(...)
control(changelist, max_events[, timeout=None]) -> eventlist
 
Calls the kernel kevent function.
- changelist must be a list of kevent objects describing the changes
  to be made to the kernel's watch list or None.
- max_events lets you specify the maximum number of events that the
  kernel will return.
- timeout is the maximum time to wait in seconds, or else None,
  to wait forever. timeout accepts floats for smaller timeouts, too.
fileno(...)
fileno() -> int
 
Return the kqueue control file descriptor.
fromfd(...)
fromfd(fd) -> kqueue
 
Create a kqueue object from a given control fd.

Data descriptors defined here:
closed
True if the kqueue handler is closed

Data and other attributes defined here:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

 
Functions
       
select(...)
select(rlist, wlist, xlist[, timeout]) -> (rlist, wlist, xlist)
 
Wait until one or more file descriptors are ready for some kind of I/O.
The first three arguments are sequences of file descriptors to be waited for:
rlist -- wait until ready for reading
wlist -- wait until ready for writing
xlist -- wait for an ``exceptional condition''
If only one kind of condition is required, pass [] for the other lists.
A file descriptor is either a socket or file object, or a small integer
gotten from a fileno() method call on one of those.
 
The optional 4th argument specifies a timeout in seconds; it may be
a floating point number to specify fractions of seconds.  If it is absent
or None, the call will never time out.
 
The return value is a tuple of three lists corresponding to the first three
arguments; each contains the subset of the corresponding file descriptors
that are ready.
 
*** IMPORTANT NOTICE ***
On Windows and OpenVMS, only sockets are supported; on Unix, all file
descriptors can be used.

 
Data
        KQ_EV_ADD = 1
KQ_EV_CLEAR = 32
KQ_EV_DELETE = 2
KQ_EV_DISABLE = 8
KQ_EV_ENABLE = 4
KQ_EV_EOF = 32768
KQ_EV_ERROR = 16384
KQ_EV_FLAG1 = 8192
KQ_EV_ONESHOT = 16
KQ_EV_SYSFLAGS = 61440
KQ_FILTER_AIO = -3
KQ_FILTER_PROC = -5
KQ_FILTER_READ = -1
KQ_FILTER_SIGNAL = -6
KQ_FILTER_TIMER = -7
KQ_FILTER_VNODE = -4
KQ_FILTER_WRITE = -2
KQ_NOTE_ATTRIB = 8
KQ_NOTE_CHILD = 4
KQ_NOTE_DELETE = 1
KQ_NOTE_EXEC = 536870912
KQ_NOTE_EXIT = -2147483648
KQ_NOTE_EXTEND = 4
KQ_NOTE_FORK = 1073741824
KQ_NOTE_LINK = 16
KQ_NOTE_LOWAT = 1
KQ_NOTE_PCTRLMASK = -1048576
KQ_NOTE_PDATAMASK = 1048575
KQ_NOTE_RENAME = 32
KQ_NOTE_REVOKE = 64
KQ_NOTE_TRACK = 1
KQ_NOTE_TRACKERR = 2
KQ_NOTE_WRITE = 2
PIPE_BUF = 512