A broadcaster.
A broadcaster. Used to control a broadcasting enumerator.
A channel for imperative style feeding of input into one or more iteratees.
Allows patching in enumerators to an iteratee.
Create a broadcaster from the given enumerator.
Create a broadcaster from the given enumerator. This allows iteratees to attach (and unattach by returning a done state) to a single enumerator. Iteratees will only receive input sent from the enumerator after they have attached to the broadcasting enumerator.
The enumerator to broadcast
Function that is invoked when all iteratees are done. May be invoked multiple times.
The context to execute the supplied function with. The context is prepared on the calling thread before being used.
A tuple of the broadcasting enumerator, that can be applied to each iteratee that wants to receive the input, and the broadcaster.
Create an enumerator and channel for broadcasting input to many iteratees.
Create an enumerator and channel for broadcasting input to many iteratees.
This is intended for imperative style push input feeding into iteratees. For example:
val (chatEnumerator, chatChannel) = Concurrent.broadcast[String] val chatClient1 = Iteratee.foreach[String](m => println("Client 1: " + m)) val chatClient2 = Iteratee.foreach[String](m => println("Client 2: " + m)) chatEnumerator |>>> chatClient1 chatEnumerator |>>> chatClient2 chatChannel.push(Message("Hello world!"))
A buffering enumeratee.
A buffering enumeratee.
Maintains a buffer of maximum size maxBuffer, consuming as much of the input as the buffer will allow as quickly as it comes, while allowing the iteratee it feeds to consume it as slowly as it likes.
This is useful in situations where the enumerator holds expensive resources open, while the iteratee may be slow, for example if the enumerator is a database result set that holds a transaction open, but the result set is being serialised and fed directly to an HTTP response.
The maximum size to buffer. The size is computed using the given length
function.
A function that computes the length of an input item
The context to execute the supplied function with. The context is prepared on the calling thread before being used.
A buffering enumeratee.
A buffering enumeratee.
Maintains a buffer of maximum size maxBuffer, consuming as much of the input as the buffer will allow as quickly as it comes, while allowing the iteratee it feeds to consume it as slowly as it likes.
This is useful in situations where the enumerator holds expensive resources open, while the iteratee may be slow, for example if the enumerator is a database result set that holds a transaction open, but the result set is being serialised and fed directly to an HTTP response.
The maximum number of items to buffer
An enumeratee that consumes all input immediately, and passes it to the iteratee only if the iteratee is ready to handle it within the given timeout, otherwise it drops it.
An enumeratee that consumes all input immediately, and passes it to the iteratee only if the iteratee is ready to handle it within the given timeout, otherwise it drops it.
The time to wait for the iteratee to be ready
The timeunit
Create a joined iteratee enumerator pair.
Create a joined iteratee enumerator pair.
When the enumerator is applied to an iteratee, the iteratee subsequently consumes whatever the iteratee in the pair is applied to. Consequently the enumerator is "one shot", applying it to subsequent iteratees will throw an exception.
Enumeratee that times out if the iteratee it feeds to takes too long to consume available input.
Enumeratee that times out if the iteratee it feeds to takes too long to consume available input.
The timeout period
the time unit
An enumerator that allows patching in enumerators to supply it with input.
An enumerator that allows patching in enumerators to supply it with input.
A function that passes a patch panel whenever the enumerator is applied to an iteratee.
The context to execute the supplied function with. The context is prepared on the calling thread before being used.
Run the enumerator, and produce the remaining enumerator as part the result.
Run the enumerator, and produce the remaining enumerator as part the result.
The result will be the result of the iteratee, and an enumerator containing the remaining input.
Create an enumerator that allows imperative style pushing of input into a single iteratee.
Create an enumerator that allows imperative style pushing of input into a single iteratee.
The enumerator may be used multiple times, each time will cause a new invocation of onStart
, which will pass a
play.api.libs.iteratee.Concurrent.Channel that can be used to feed input into the iteratee. However, note that
there is no way for the caller to know which iteratee is finished or encountered an error in the onComplete
or
onError
functions.
Called when an enumerator is applied to an iteratee, providing the channel to feed input into that iteratee.
Called when an iteratee is done.
Called when an iteratee encounters an error, supplying the error and the input that caused the error.
The context to execute the supplied functions with. The context is prepared on the calling thread before being used.
Utilities for concurrent usage of iteratees, enumerators and enumeratees.