Class: cogen.core.reactors.ReactorBase
A reactor just checks if there are ready-sockets for the operations. The operations are not done here, they are done in the socket ops instances.
Constructor
__init__ (self, scheduler, resolution)
Methods
__init__ (self, scheduler, resolution)
__len__ (self)
Returns number of waiting operations registered in the reactor.
add (self, op, coro)
Implemented by the child class that actualy implements the polling. Registers an operation.
handle_errored (self, desc, code=None)
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 reactor and return the result. Called from the main reactor loop.
run_operation (self, op, reactor=True)
Run the socket op and return result or exception.
run_or_add (self, op, coro)
Perform operation and return result or add the operation in the reactor if socket isn't ready and return none. Called from the scheduller via SocketOperation.process.
waiting_op (self, testcoro)
Returns the registered operation for some specified coroutine.