Packages

trait Fiber[+E, +A] extends AnyRef

A fiber is a lightweight thread of execution that never consumes more than a whole thread (but may consume much less, depending on contention). Fibers are spawned by forking IO actions, which, conceptually at least, runs them concurrently with the parent IO action.

Fibers can be joined, yielding their result other fibers, or interrupted, which terminates the fiber with a runtime error.

Fork-Join Identity: fork >=> join = id

for {
  fiber1 <- io1.fork
  fiber2 <- io2.fork
  _      <- fiber1.interrupt(e)
  a      <- fiber2.join
} yield a
Self Type
Fiber[E, A]
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Fiber
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def await: UIO[Exit[E, A]]

    Awaits the fiber, which suspends the awaiting fiber until the result of the fiber has been determined.

  2. abstract def interrupt: UIO[Exit[E, A]]

    Interrupts the fiber with no specified reason.

    Interrupts the fiber with no specified reason. If the fiber has already terminated, either successfully or with error, this will resume immediately. Otherwise, it will resume when the fiber completes.

  3. abstract def poll: UIO[Option[Exit[E, A]]]

    Tentatively observes the fiber, but returns immediately if it is not already done.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def *>[E1 >: E, B](that: Fiber[E1, B]): Fiber[E1, B]

    Same as zip but discards the output of the left hand side.

  4. final def <*[E1 >: E, B](that: Fiber[E1, B]): Fiber[E1, A]

    Same as zip but discards the output of the right hand side.

  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  8. final def const[B](b: ⇒ B): Fiber[E, B]

    Maps the output of this fiber to the specified constant.

  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  15. final def join: IO[E, A]

    Joins the fiber, which suspends the joining fiber until the result of the fiber has been determined.

    Joins the fiber, which suspends the joining fiber until the result of the fiber has been determined. Attempting to join a fiber that has errored will result in a catchable error, _if_ that error does not result from interruption.

  16. final def map[B](f: (A) ⇒ B): Fiber[E, B]

    Maps over the value the Fiber computes.

  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. def orElse[E1 >: E, A1 >: A](that: Fiber[E1, A1]): Fiber[E1, A1]

    Returns a fiber that prefers the left hand side, but falls back to the right hand side when the left fails.

  21. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  22. final def toFuture(implicit ev: <:<[E, Throwable]): UIO[Future[A]]

    Converts this fiber into a scala.concurrent.Future.

  23. final def toFutureWith(f: (E) ⇒ Throwable): UIO[Future[A]]

    Converts this fiber into a scala.concurrent.Future, translating any errors to java.lang.Throwable with the specified conversion function.

  24. def toString(): String
    Definition Classes
    AnyRef → Any
  25. final def void: Fiber[E, Unit]

    Maps the output of this fiber to ().

  26. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  29. final def zip[E1 >: E, B](that: ⇒ Fiber[E1, B]): Fiber[E1, (A, B)]

    Zips this fiber and the specified fiber togther, producing a tuple of their output.

  30. final def zipLeft[E1 >: E, B](that: Fiber[E1, B]): Fiber[E1, A]

    Named alias for <*.

  31. final def zipRight[E1 >: E, B](that: Fiber[E1, B]): Fiber[E1, B]

    Named alias for *>.

  32. final def zipWith[E1 >: E, B, C](that: ⇒ Fiber[E1, B])(f: (A, B) ⇒ C): Fiber[E1, C]

    Zips this fiber with the specified fiber, combining their results using the specified combiner function.

    Zips this fiber with the specified fiber, combining their results using the specified combiner function. Both joins and interruptions are performed in sequential order from left to right.

Inherited from AnyRef

Inherited from Any

Ungrouped