object Spool
Note: Spool is no longer the recommended asynchronous stream abstraction. We encourage you to use AsyncStream instead.
Note: There is a Java-friendly API for this object: com.twitter.concurrent.Spools.
- Alphabetic
- By Inheritance
- Spool
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- case class Cons[A](head: A, tail: Future[Spool[A]]) extends Spool[A] with Product with Serializable
- class Syntax[A] extends AnyRef
Syntax support.
Syntax support. We retain different constructors for future resolving vs. not.
*:: constructs and deconstructs deferred tails **:: constructs and deconstructs eager tails
- class Syntax1[A] extends AnyRef
- class ToSpool[A] extends AnyRef
Adds an implicit method to efficiently convert a Seq[A] to a Spool[A]
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def empty[A]: Spool[A]
The empty spool.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def fromSeq[A](seq: Seq[A]): Spool[A]
Lazily builds a Spool from a Seq.
Lazily builds a Spool from a Seq.
The main difference between this and
seqToSpool
is that this method also consumes the Seq lazily, which means if used with Streams, it will preserve laziness. - final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def merge[A](spools: Seq[Future[Spool[A]]]): Future[Spool[A]]
Merges spools as they're ready, or evenly between the ready spools if there's more than one ready, until every spool is empty.
Merges spools as they're ready, or evenly between the ready spools if there's more than one ready, until every spool is empty. Fails the tail of the returned Spool when any of the Spools you're merging over fails.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- implicit def seqToSpool[A](s: Seq[A]): ToSpool[A]
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- implicit def syntax[A](s: => Future[Spool[A]]): Syntax[A]
- implicit def syntax1[A](s: Spool[A]): Syntax1[A]
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- object **::
- object *::
- object Empty extends Spool[Nothing]
Deprecated Value Members
- def cons[A](value: A, nextSpool: Spool[A]): Spool[A]
- Annotations
- @deprecated
- Deprecated
(Since version 6.14.1) Use *:: instead: the ABI for this method will be changing.
- def cons[A](value: A, next: Future[Spool[A]]): Spool[A]
Cons a value & tail to a new {{Spool}}.
Cons a value & tail to a new {{Spool}}. To defer the tail of the Spool, use the {{*::}} operator instead.
- Annotations
- @deprecated
- Deprecated
(Since version 6.14.1) Use *:: instead: the ABI for this method will be changing.