Class: cogen.core.pollers.Poller

A poller just checks if there are ready-sockets for the operations. The operations are not done here, they are done in the socket ops instances.

Methods

__init__ (self, scheduler)

__len__ (self)

Returns number of waiting operations registered in the poller.

add (self, op, coro)

Implemented by the child class that actualy implements the polling. Registers an operation.

handle_errored (self, desc)

Handles descriptors that have errors.

remove (self, op, coro)

Implemented by the child class that actualy implements the polling. Removes a operation.

run (self, timeout=0)

Implemented by the child class that actualy implements the polling. Calls the underlying OS polling mechanism and runs the operations for any ready descriptor.

run_once (self, fdesc, waiting_ops)

Run a operation, remove it from the poller and return the result. Called from the main poller loop.

run_operation (self, op)

Run the socket op and return result or exception.

run_or_add (self, op, coro)

Perform operation or add the operation in the poller if socket isn't ready. Called from the scheduller.

waiting_op (self, testcoro)

Returns the registered operation for some specified coroutine.