Adapt an Accumulator to an Iteratee.
Adapt an Accumulator to an Iteratee.
This is done by creating an Akka streams Subscriber based Source, and adapting that to an Iteratee, before running the Akka streams source.
This method for adaptation requires a Materializer to materialize the subscriber, however it does not materialize the subscriber until the iteratees fold method has been invoked.
Adapt an Enumeratee to a Processor.
Adapt an Enumerator to a Publisher.
Adapt an Enumerator to a Publisher. Each Subscriber will be adapted to an Iteratee and applied to the Enumerator. Input of type Input.El will result in calls to onNext.
Either onError or onComplete will always be invoked as the last call to the subscriber, the former happening if the enumerator fails with an error, the latter happening when the first of either Input.EOF is fed, or the enumerator completes.
If emptyElement is None then Input of type Input.Empty will be ignored. If it is set to Some(x) then it will call onNext with the value x.
Adapt a Future into a Publisher.
Adapt a Future into a Publisher. For a successful Future the Publisher will emit a single element with the value. For a failed Future the Publisher will emit an onError event.
Adapt an Iteratee to a Publisher, publishing its Done value.
Adapt an Iteratee to a Publisher, publishing its Done value. If the iteratee is *not* Done then an exception is published.
This method is similar in its effect to Iteratee.run, which extracts the final value from an Iteratee. However, unlike Iteratee.run, this method will not feed an EOF input to the Iteratee.
Adapt an Iteratee to an Accumulator.
Adapt an Iteratee to an Accumulator.
This is done by adapting the iteratee to a subscriber, and then creating an Akka streams Sink from that, which is mapped to the result of running the adapted iteratee subscriber result.
Adapt an Iteratee to a Processor, which consumes input and then yields the iteratee's Done value.
Adapt an Iteratee to a Processor, which consumes input and then yields the iteratee's Done value. It uses iterateeToSubscriber and iterateeDoneToPublisher to create each end of the Processor.
Adapt an Iteratee to a Subscriber and a result Iteratee.
Adapt an Iteratee to a Subscriber and a result Iteratee.
The Subscriber requests elements one-by-one and feeds them to each Iteratee Cont step. When the Iteratee step is Done or Error, the Subscription is cancelled.
The result iteratee will be fulfilled when either the Iteratee or the Subscriber subscription completes. The result Iteratee may be in a Cont, Done or Error state, or a fourth state that will yield errors or failed Futures when its methods are called.
Calls to onNext send an Input.El to the iteratee and calls to onComplete send an Input.EOF. If onError is called then the iteratee enters an invalid state.
If the Iteratee is in a Done or Error state then it will cancel the Subscription as soon as possible, but it may still receive calls to onError or onComplete. These calls are ignored. Be careful because this means that it is possible for the Subscriber to "consume" events, even if the Iteratee doesn't.
Join a Subscriber and Publisher together to make a Processor.
Join a Subscriber and Publisher together to make a Processor. The Processor delegates its Subscriber methods to the Subscriber and its Publisher methods to the Publisher. The Processor otherwise does nothing.
Adapt a Processor to an Enumeratee.
Adapt a Promise into a Processor, creating an Processor that consumes a single element and publishes it.
Adapt a Promise into a Processor, creating an Processor that
consumes a single element and publishes it. The Subscriber end
of the Processor is created with promiseToSubscriber
. The
Publisher end of the Processor is created with futureToPublisher
.
Adapt a Promise into a Subscriber.
Adapt a Promise into a Subscriber. The Subscriber accepts a single value which is used to complete the Promise. If the Subscriber's onError method is called then the Promise is completed with a failure.
A call to onError after onNext is called will be ignored.
Adapt a Publisher to an Enumerator.
Adapt a Publisher to an Enumerator. This is achieved by adapting any Iteratees into Subscribers using the iterateeToSubscriber method.
Adapt a Subscriber to an Iteratee.
Adapt a Subscriber to an Iteratee.
The Iteratee will attempt to give the Subscriber as many elements as demanded. When the subscriber cancels, the iteratee enters the done state.
Feeding EOF into the iteratee will cause the Subscriber to be fed a completion event, and the iteratee will go into the done state.
The iteratee will not enter the Cont state until demand is requested by the subscriber.
This Iteratee will never enter the error state, unless the subscriber deviates from the reactive streams spec.
Methods to adapt Futures, Promises, Iteratees and Enumerators to and from Reactive Streams' Publishers and Subscribers.