Skip to content
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

Operator: ToIterable #18

Closed
benjchristensen opened this issue Jan 16, 2013 · 4 comments
Closed

Operator: ToIterable #18

benjchristensen opened this issue Jan 16, 2013 · 4 comments
Milestone

Comments

@benjchristensen
Copy link
Member

We already from toObservable(Iterable)/from(Iterable) ... add the reverse blocking toIterable() similar to the non-blocking toList() which already exists.

ToEnumerable from C#: http://msdn.microsoft.com/en-us/library/hh212132(v=vs.103).aspx

@mairbek
Copy link
Contributor

mairbek commented Feb 27, 2013

ToEnumerable don't seems to be different from ToList.

First one returns IObservable<IList<TSource>> second one IEnumerable<TSource>.

@benjchristensen
Copy link
Member Author

The toList operator is non-blocking as it returns Observable<List> whereas to Iterable is blocking and returns Iterable.

The key difference is non-blocking versus blocking, otherwise yes, they behave similarly.

The other difference though is that toList will wait until the observable sequence is onCompleted() and then emit the List whereas toIterable will buffer but start allowing take() to be called immediately as each onNext() value is emitted.

@benjchristensen
Copy link
Member Author

Merged.

@benjchristensen
Copy link
Member Author

By the way ... a key difference in Java is that Iterable is not an equal dual with Observable whereas IEnumerable is a dual to IObservable in .Net where both have extension methods with all the functional operators.

Since Java doesn't have extension methods we can't do that here. At best we could have another parallel framework for wrapping an Iterable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants