arrow-fx / arrow.fx.typeclasses / Fiber


@higherkind interface Fiber<F, out A>

Fiber represents the pure result of an Async data type being started concurrently and that can be either joined or canceled.

You can think of fibers as being lightweight threads, a Fiber being a concurrency primitive for doing cooperative multi-tasking.


cancel Triggers the cancellation of the Fiber.abstract fun cancel(): CancelToken<F>
component1 open operator fun component1(): Kind<F, A>
component2 open operator fun component2(): CancelToken<F>
join Returns a new task that will await for the completion of the underlying Fiber, (asynchronously) blocking the current run-loop until that result is available.abstract fun join(): Kind<F, A>

Companion Object Functions

invoke Fiber constructor.operator fun <F, A> invoke(join: Kind<F, A>, cancel: CancelToken<F>): Fiber<F, A>

Companion Object Extension Functions

applicative fun <F> Fiber.Companion.applicative(C: Concurrent<F>): Applicative<Kind<<ERROR CLASS>, F>>
apply fun <F> Fiber.Companion.apply(C: Concurrent<F>): Apply<Kind<<ERROR CLASS>, F>>
functor fun <F> Fiber.Companion.functor(C: Concurrent<F>): Functor<Kind<<ERROR CLASS>, F>>
monoid fun <F, A> Fiber.Companion.monoid(C: Concurrent<F>, M: Monoid<A>): Monoid<Fiber<F, A>>
semigroup fun <F, A> Fiber.Companion.semigroup(C: Concurrent<F>, S: Semigroup<A>): Semigroup<Fiber<F, A>>

Do you like Arrow?

Arrow Org