Reputation: 16874
I am waiting for a particular value in a stream, at which point, I want to do some work in my subscriber and also unsubscribe from the ongoing stream. What is the best syntax for doing that?
Upvotes: 1
Views: 687
Reputation: 29796
Something like this:
var value = stream.Where(/* predicate to select value of interest */)
.Take(1)
.Subscribe(value => /* do work */);
Upvotes: 8