Package

com.twitter.concurrent

exp

Permalink

package exp

Visibility
  1. Public
  2. All

Type Members

  1. final class AsyncStream[+A] extends AnyRef

    Permalink

    A representation of a lazy (and possibly infinite) sequence of asynchronous values.

    A representation of a lazy (and possibly infinite) sequence of asynchronous values. We provide combinators for non-blocking computation over the sequence of values.

    It is composable with Future, Seq and Option.

    val ids = Seq(123, 124, ...)
    val users = fromSeq(ids).flatMap(id => fromFuture(getUser(id)))
    
    // Or as a for-comprehension...
    
    val users = for {
      id <- fromSeq(ids)
      user <- fromFuture(getUser(id))
    } yield user

    All of its operations are lazy and don't force evaluation, unless otherwise noted.

    The stream is persistent and can be shared safely by multiple threads.

Value Members

  1. object AsyncStream

    Permalink

Ungrouped