ev_io

Graham Leggett minfrin at sharp.fm
Sat Dec 6 21:41:27 CET 2008


Marc Lehmann wrote:

>> ev_stat is suboptimal for my case (due to the delay),
>    
> The delay is only there on operating systems that don't allow implementing
> it in other ways (so yes, on OS X there is a delay).

What I have currently managed to get working is a combination of the 
idle watcher, and the stat watcher. The idle watcher reads the file, 
until there is no more file to read, then the idle watcher switches 
itself off. The stat watcher then switches the idle watcher back on 
again if a modification to the file is detected. Reading the file in one 
go won't work for me, as it will potentially block the event loop.

The target environment is Linux, which supports inotify, so in theory 
there should be little or no delay once in live use.

Regards,
Graham
--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3287 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.schmorp.de/pipermail/libev/attachments/20081206/d1072f2e/attachment.bin>


More information about the libev mailing list