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. |
Internal for Win32ReactorThread: Queue a callback and signal the internal event.
Only to be called with mutex locked.| Parameters | event | The event to watch. |
| method | This will be called when the event is fired. |
| Parameters | handle | The handle of the Event to watch. |