|John-Mark Gurney 9e082a8487||9 kuukautta sitten|
|aiokq||9 kuukautta sitten|
|misc||9 kuukautta sitten|
|.gitignore||9 kuukautta sitten|
|LICENSE.txt||9 kuukautta sitten|
|Makefile||9 kuukautta sitten|
|README.md||9 kuukautta sitten|
|requirements.txt||9 kuukautta sitten|
|setup.py||9 kuukautta sitten|
This is a module to make select.kqueue module compatible with programs that use asyncio.
The core of kqueue is already implemented via the core asyncio, but other parts of kqueue, like EVFILT_VNODE and EVFILT_PROC are not. This module is currently limited to supporting basic EVFILT_VNODE functionality.
To watch a file for modification:
fp = open(fname) async with aiokq.watch_file(fp) as wf: while True: data = fp.read() # do some work on data # wait for a modification await wf()
The with symantics is required in order to address the race where a write is issued between the registration and the time that you do the read. There is the possibility that a wakeup happens and there are no modifications due to this race.