kevinohara80 / nforce

nforce is a node.js salesforce REST API wrapper for force.com, database.com, and salesforce.com
MIT License
474 stars 167 forks source link

Update query() to be either in streaming mode or non-streaming mode #18

Closed chrishic closed 11 years ago

chrishic commented 11 years ago

These changes were necessary to enable streaming mode to pull back large amounts of data (>90000 contacts) via calls to getNextUrl. query() is now either in streaming mode or non-streaming mode. When in streaming mode, no callback is used and instead stream events are emitted. When in non-streaming mode, callback is used for control flow.

kevinohara80 commented 11 years ago

I see. Looks good and makes total sense. Let me test this tomorrow.

chrishic commented 11 years ago

Great, thanks for the quick turnaround on reviewing the PR. And a big shout out to you for putting this module together. I've been using it since last September, and its become a key piece of my app. Thank you!

adambreen commented 11 years ago

It appears that this commit also fixes a problematic memory leak. :+1:

With the latest trunk, my app (which also pulls down a large amount of data) accumulates non-garbage-collectable resources with every nforce query (even using pipes).

I switched to @chrishic 's fork (and indeed, just this commit) and the memory leak disappeared :)

kevinohara80 commented 11 years ago

Thanks for the PR. Landed in Master and will be in the next release.

kevinohara80 commented 11 years ago

Aaaaaaand it's in 0.4.4

Thanks again.

chrishic commented 11 years ago

Awesome - thanks so much!