-
Notifications
You must be signed in to change notification settings - Fork 1
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 with changefeeds? #3
Comments
Yup, works with all rethinkdb cursors |
Well, changefeeds have no end/close, so would the onCompleted() ever get called? I'd like to use the toArray() behavior of non-changefeed-cursors, but with changefeeds, instead of using each() logic. |
Exactly! 'onCompleted' will never be called with changefeed cursors. You will have to dispose the subscription to close the cursor. Also keep in mind, this inherits from the base Observable (not ConnectableObservable). I am not sure if your familiar with connectable observables and rxjs. To subscribe to the observable multiple times you'll probably use 'publish().refCount()'. |
Gotcha, thanks. |
I don't fully understand what you're wanting out of toArray(), but assuming you know some scenario where you want to stop listening to the changefeed.. I'm sure there is an rxjs observable operator that trigger 'completed' after it receives a certain number of results or passes some test. |
Or obviously, just unsubscribe after you get the last result you want. |
Does this work with changefeeds?
The text was updated successfully, but these errors were encountered: