+str - Fixes #16065 by adding an IteratorPublisher and removing SimpleCallbackPublisher

Adds an IteratorPublisher and IteratorPublisherImpl
Removes the SimpleCallbackPublisher
Switches the callback-source () => Option[T] to use a new ThunkIterator and the IteratorPublisher
Removes the use of a ControlThrowable (Stop) for signalling end since we now use Iterator
Improves a couple of streams-related tests so when they fail we get better output
This commit is contained in:
Viktor Klang 2014-11-07 18:02:29 +01:00
parent d60d5bc849
commit 18067cbf8f
9 changed files with 71 additions and 83 deletions

View file

@ -116,7 +116,7 @@ object Source {
* The stream ends normally when evaluation of the closure returns a `None`.
* The stream ends exceptionally when an exception is thrown from the closure.
*/
def apply[T](f: () Option[T]): Source[T] = ThunkSource(f)
def apply[T](f: () Option[T]): Source[T] = IteratorSource(new ThunkIterator(f))
/**
* Start a new `Source` from the given `Future`. The stream will consist of