python - Can asyncio be extended to watch for handles created with pywin32 -
i have windows python (3.4.x) program in wish wait user actions coming queuing.queue , filesystem changed notifications (win32 findfirstchangenotification, etc.). current plan associate win32 event object (created createevent) queue, , when action queued, signal event object. thread loop on win32 waitformultipleobjects call , dispatch events. use pywin32 calling win32 api.
i take approach on different project , works fine. however, wondering if there's way implement behavior on top of asyncio module.
using pywin32 extensions, possible wait windows event using win32event api. waiting blocking operation.
until pywin32 event waiting has direct asyncio support, asyncio makes possible wait events using so-called thread pool executor, runs blocking wait in separate thread. there's process executor delegate blocking operations process rather thread.
Comments
Post a Comment