3 ms·
I see what you're getting at. Behind the scenes, I am ultimately using an event loop :) Having said that, since MongoDB is a persistent connection, does long pu
by BenjaminCoe 15y ago
I see what you're getting at. Behind the scenes, I am ultimately using an event loop :) Having said that, since MongoDB is a persistent connection, does long pulling over HTTP make sense for the client?
I was thinking of doing a proof of concept in Node, that would at least behave like it's getting pushed messages rather than pulling ... But, I couldn't think of a way other than repeated setTimeouts.
Any thoughts?
- Todd 15y agoNode would work well since it's designed to support async patterns. You're right that the challenge is the polling model that you have to implement when using MongoDB as the queue. To get throughput, you may have to use it as a journal and implement the queue within your process. Check out Kestrel on GitHub for an example.