Comments (6)
Correct me if I'm wrong, but wouldn't that limit the number of workers to one per queue or cursor? Also, there would need to be some work involved to make sure you didn't lose any jobs if the cursor closed I'm thinking.
On Thursday, November 3, 2011 at 1:39 PM, Greg Weber wrote:
- [http://www.captaincodeman.com/2011/05/28/simple-service-bus-message-queue-mongodb/](C# demonstration code)
- [https://gist.github.com/665978](Ruby tailable cursor code).
Reply to this email directly or view it on GitHub:
#33
from qu.
Yes, you will still need to modify members of the collection to mark them
as finished so you know how to recover. This could be done by unsetting a
created_at field. You probably do only want to have one tailing cursor, but
that process could broker the queue to any number of consumers.
.
On Thu, Nov 3, 2011 at 11:42 AM, John Nunemaker <
[email protected]>wrote:
Correct me if I'm wrong, but wouldn't that limit the number of workers to
one per queue or cursor? Also, there would need to be some work involved to
make sure you didn't lose any jobs if the cursor closed I'm thinking.On Thursday, November 3, 2011 at 1:39 PM, Greg Weber wrote:
- [
http://www.captaincodeman.com/2011/05/28/simple-service-bus-message-queue-mongodb/](C#demonstration code)- [https://gist.github.com/665978](Ruby tailable cursor code).
Reply to this email directly or view it on GitHub:
#33
Reply to this email directly or view it on GitHub:
#33 (comment)
from qu.
That's a really interesting idea. It would be great if you could use a tailable cursor with the findAndModify command.
Any idea how we could do this without creating contention between workers?
from qu.
You still have to use findAndModify to flag a document as finished
processing. Using the broker technique means only the broker accesses the
database, so there is no database contention between workers and the broker
can also supervise workers.
Other articles on this approach:
- a benchmark demonstrating very good performance [1]
- others using findAndModify instead of RabbitMQ [2]
- a Lift chat app using tailable cursors [3]
[1] http://www.shtylman.com/archives/217
[2] http://blog.boxedice.com/2011/09/28/replacing-rabbitmq-with-mongodb/
[3] http://amoss.me/lift-chat-with-mongodb-tailable-cursors
On Thu, Nov 3, 2011 at 1:38 PM, Brandon Keepers <
[email protected]>wrote:
That's a really interesting idea. It would be great if you could use a
tailable cursor with the findAndModify command.Any idea how we could do this without creating contention between workers?
Reply to this email directly or view it on GitHub:
#33 (comment)
from qu.
Hi all... I thought I'd drop by to say I've logged a feature request to have findAndModify return tailable cursors:
https://jira.mongodb.org/browse/SERVER-11753
This would allow blocking reads instead of polling (via tailable cursors), plus the guarantee that only one consumer would get any given job (via findAndModify). Please vote for it if you're interested in this functionality.
from qu.
If anyone wants to tackle this feel free to create a new backend like tailable_mongo or something.
from qu.
Related Issues (20)
- RabbitMQ vs Bunny HOT 3
- Docs don't match current release version? HOT 3
- jobs processed even when queue is not running HOT 6
- [HireFire] Extract a "working" worker's job's queue name HOT 3
- Question: How to handle completed jobs? Any callback? HOT 1
- Auto Redic/Mongo mount while rake spec HOT 1
- Failing test for Mongo backend HOT 1
- db_name must be a string or symbol HOT 6
- Daemonize qu:work HOT 1
- Current status of project HOT 6
- Backend should be notified of failures HOT 1
- Raise error if no queue given to worker HOT 1
- Jobs are currently retried until they succeed
- Worker heartbeat HOT 4
- New gem release? HOT 1
- Move kestrel thrift stuff to its own gem HOT 1
- Release new version HOT 1
- Process payloads in batches HOT 6
- Allow backends to implement batch pop
- Allow backends to implement batch push HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qu.