pstiasny / bigos

Do stuff on file change.
GNU General Public License v3.0
0 stars 0 forks source link

``bigos.backend.generate_events`` -- Blocking/Asynchronous? #1

Closed prologic closed 10 years ago

prologic commented 10 years ago

Hi Paweł! Nice project btw!

Q: Will bigos.backend.generate_events block if there are no pending events?

Basically I would like to see how well this library of yours plays with an event-driven framework such as circuits[1] which also has a inotify component[2].

cheers James

  1. https://pypi.python.org/pypi/circuits
  2. https://bitbucket.org/circuits/circuits/src/tip/circuits/io/notify.py
pstiasny commented 10 years ago

Hi and thanks,

Yes, generate_events will block. It's a plain generator that is supposed to act as a glue between various backends. However, in the next revision there will most probably be a nonblocking method to go with the blocking lower-level bigos.backend.inotify.Inotify.get_event, for the purpose of debouncing (i. e. merging together events coming in a fixed time period). For the sake of simplicity I would like that to also be synchronous (i. e. polling only).

That said, feel free to extend the Inotify backend for whatever you need.

Does that answer your question?

prologic commented 10 years ago

Well yes sort of. I was interested inw hat you've done to see how we could integrate your library and it's multiple backend support into something like circuits (which already has a inotify component, but no other paltform support).

cheers James

James Mills / prologic

E: prologic@shortcircuit.net.au W: prologic.shortcircuit.net.au

On Mon, Mar 24, 2014 at 5:38 PM, Paweł Stiasny notifications@github.comwrote:

Hi and thanks,

Yes, generate_events will block. It's a plain generator that is supposed to act as a glue between various backends. However, in the next revision there will most probably be a nonblocking method to go with the blocking lower-level bigos.backend.inotify.Inotify.get_event, for the purpose of debouncing (i. e. merging together events coming in a fixed time period). For the sake of simplicity I would like that to also be synchronous (i. e. polling only).

That said, feel free to extend the Inotify backend for whatever you need.

Does that answer your question?

— Reply to this email directly or view it on GitHubhttps://github.com/pstiasny/bigos/issues/1#issuecomment-38418087 .

pstiasny commented 10 years ago

I see. Well, I didn't really design it with async in mind, but I'll keep that in mind for the future. If you decide to integrate some of my code, please let me know - I might need to relicense to something like LGPL. Please close the issue if you have no more questions.

cheers

prologic commented 10 years ago

No problems! Thanks!