Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use cases #15

Open
danielsz opened this issue Apr 3, 2017 · 1 comment
Open

Use cases #15

danielsz opened this issue Apr 3, 2017 · 1 comment

Comments

@danielsz
Copy link

danielsz commented Apr 3, 2017

Hi,

I've successfully implemented a durable queue according to the stated use case, as an in-process device that does both the puts and takes. However, initially I had a misgiving, and I had two processes, one doing the puts, the other the takes. This did not work. Despite the fact that the queue object was pointing to the same underlying file, the puts of one process did not result in tasks visible to takes in the second process. Now I am just curious, what are the technical reasons for this. Intuitively, I though that no further synchronization was needed beyond fsync to make this work.

Thank you in advance.

@ztellman
Copy link
Contributor

ztellman commented Sep 6, 2017

I saw a link to this, and so I'll just answer this for posterity. The "state" of the task queue largely resides in-memory, with things persisted to disk just to make sure that the state can be recomputed by a linear scan of the entire task queue if the process every closes down.

To have separate processes which communicate via the task queue would require, at the very least, a way for the consumer process to be signaled whenever there's a new task available. There would also need to be some thought given as to who's responsible for GCing the on-disk slab files, and probably some other stuff I'm not remembering. It's all very doable, but wasn't necessary in the use case I built it for, and is unlikely to be added at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants