dispatch_once(self,
timeout,
error_in_handler)
|
|
Perform the implementation specific dispatch.
Typically this involves a single call to select or poll followed by a
call to the dispatch_event method of each dispatch target for which
events are pending. Implementations are required to convert any event
details into the (R,W,E) form, respectively Readable, Writeable and
Exceptional. Provided that each field evaluates False when there are no
events for that field and True otherwise; implementations should as far
as possible preserve the implementation specific values. Eg., for poll,
the R, W, E fields are obtained as:
R, W, E = (
flags & (select.POLLIN | select.POLLPRI),
flags & select.POLLOUT,
flags & select.POLLERR | select.POLLHUP | select.POLLNVAL
)
See asycamore.servicemodel for further discussion of the event format
and how dispatch_once can co-operate with service model
implementations.
If error_in_handler is not None and an exception other than
KeyboardInterrupt or SystemExit is raised when dispatch target is
called it is called like:
error_in_handler(o, exc_info)
If error_in_handler not provided or the provided implementation raises
a further exception then the exception propogates to the caller.
NOTE: KeyboardInterupt or SystemExit NEVER get passed to
error_in_handler
- Parameters:
timeout - None or 0 are always legal and behave as per sleep(0).
Otherwise, an Implementation specific value determining the maximum
you would ideally allow the OS to wait before deciding there are
no events of interest. All implementations are required to support
0 and None as per sleep(0).
error_in_handler - The optional error handler for exceptions raised in a dispatch
target
|