A broadcaster.
A channel for imperative style feeding of input into one or more iteratees.
Allows patching in enumerators to an iteratee.
(Since version 2.1.0) use Concurrent.broadcast instead
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.
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
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
Enumeratee that times out if the iteratee it feeds to takes to long to consume available input.
Enumeratee that times out if the iteratee it feeds to takes to 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.
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.
(Since version 2.1.0) use Concurrent.broadcast instead
Utilities for concurrent usage of iteratees, enumerators and enumeratees.