Announcing libasync, a cross-platform D event loop

Etienne via Digitalmars-d digitalmars-d at puremagic.com
Wed Sep 24 13:09:32 PDT 2014


On 2014-09-24 3:15 PM, Jacob Carlborg wrote:
> Shouldn't the directory watcher use FSEvents on OS X?
>

I've thought about it but it isn't compatible with other BSD platforms 
and has no docs about using it with kqueue, it ended up looking more 
complicated and unstable because I could read complaints everywhere I 
looked. It ended up putting me in a direction where I needed separate 
threads with their own event loops and communication through signals, 
which didn't fit in with what I was used to doing from what the other 
platforms offered.

I found the solution with kqueue's vnode, which acts like inotify. It 
doesn't have recursion nor file modification events when watching 
folders so individual files had to be watched and the directories 
checked against cache data every time an event came in. It seems a lot 
more flexible on the long run, and making feature additions / 
compatibility adjustments didn't sound like a nightmare on the long run.


More information about the Digitalmars-d mailing list