Working of a QueryStream

21 views
Skip to first unread message

Adam Hull

unread,
Aug 17, 2013, 6:39:03 PM8/17/13
to mongoo...@googlegroups.com
When streaming a query, I'll often do some work with each document (like update the document or send an email).  It seems there's a risk the stream will emit faster than my work for each document finish, potentially snowballing workers in node up to the size of the streamed query.  Anyone else seen this?

I extracted a strategy we've been using at Good Eggs into a plugin that augments QueryStream.  Thoughts?

Aaron Heckmann

unread,
Aug 20, 2013, 6:36:07 PM8/20/13
to mongoo...@googlegroups.com


On Sat, Aug 17, 2013 at 3:39 PM, Adam Hull <ad...@hmlad.com> wrote:
When streaming a query, I'll often do some work with each document (like update the document or send an email).  It seems there's a risk the stream will emit faster than my work for each document finish, potentially snowballing workers in node up to the size of the streamed query.  Anyone else seen this?

I extracted a strategy we've been using at Good Eggs into a plugin that augments QueryStream.  Thoughts?

--
Documentation - http://mongoosejs.com/
Plugins - http://plugins.mongoosejs.com/
Bug Reports - http://github.com/learnboost/mongoose
Production Examples - http://mongoosejs.tumblr.com/
StackOverflow - http://stackoverflow.com/questions/tagged/mongoose
Google Groups - https://groups.google.com/forum/?fromgroups#!forum/mongoose-orm
Twitter - https://twitter.com/mongoosejs
IRC - #mongoosejs
---
You received this message because you are subscribed to the Google Groups "Mongoose Node.JS ODM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongoose-orm...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Aaron


Adam Hull

unread,
Aug 20, 2013, 8:21:30 PM8/20/13
to mongoo...@googlegroups.com
Oof.  Thanks Aaron.  Fix is in.  CoffeeScript is reinforcing bad habits...
Reply all
Reply to author
Forward
0 new messages