Class a.w.Win32Reactor(threading.Thread):

Part of aculab.win32reactor View Source View In Hierarchy

Event reactor for Windows.

Manages multiple reactor threads to work around the 64 handles limitation. Each SpeechChannel uses 3 event handles, so this happens quickly.

(This sucks, BTW, we need two context switches instead of one for each event. But we can't use IO Completion Ports here.

An alternative would be to drop the guarantuee that all callbacks will be called from reactor.run, but that is not a friendly default)
Method __init__ Undocumented
Method add_timer Add a timer after interval in seconds.
Method cancel_timer Cancel a timer.
Method enqueue Internal for Win32ReactorThread:
Method add Add a new handle to the reactor.
Method remove Remove an event from the reactor.
Method start_workers Start the thread workers.
Method stop_workers Stop all worker threads.
Method start Start the reactor in a new thread.
Method run Run the reactor in the current thread.
def __init__(self): (source)
Undocumented
def add_timer(self, interval, function, args=, kwargs={}): (source)
Add a timer after interval in seconds.
def cancel_timer(self, timer): (source)
Cancel a timer. Cancelling an expired timer raises a ValueError
def enqueue(self, m): (source)

Internal for Win32ReactorThread: Queue a callback and signal the internal event.

Only to be called with mutex locked.
def add(self, event, method): (source)
Add a new handle to the reactor.
ParameterseventThe event to watch.
methodThis will be called when the event is fired.
def remove(self, event): (source)
Remove an event from the reactor.
ParametershandleThe handle of the Event to watch.
def start_workers(self): (source)
Start the thread workers.
def stop_workers(self): (source)
Stop all worker threads.
def start(self): (source)
Start the reactor in a new thread.
def run(self): (source)
Run the reactor in the current thread.
API Documentation for pyAculab, generated by pydoctor at 2009-01-02 15:12:29.