Skip to content

ribs_effect

A functional effects library for Dart, providing a purely functional abstraction for managing side-effects, concurrency, resource safety, and asynchronous execution.

Features powerful primitives like IO and Resource, alongside concurrent data structures like Queue, Semaphore, and Ref.

Classes

ClassDescription
BackpressureA concurrency primitive that limits the rate of effect execution.
Canceled<A>IO Outcome when it was canceled before completion.
CountDownLatchA synchronization primitive that allows one or more fibers to wait until a set of operations completes.
CyclicBarrierA reusable synchronization barrier for a fixed number of fibers.
Deferred<A>A purely functional synchronization primitive.
Dequeue<A>A concurrent, fiber-safe double-ended queue (deque).
DispatcherProvides an unsafe API for running IO effects from outside the IO world, bridging purely functional code to callback-based or Future-based interfaces.
Errored<A>Failed Outcome of an IO evaluation, with the Object that caused it.
ExitCaseRepresents the outcome of performing some kind of computation. The exit case can be one of 3 states:
Hotswap<R>A concurrency primitive for atomically swapping a Resource-managed value at runtime.
IO<A>IO is a datatype that can be used to control side-effects within synchronous and asynchronous code.
IOFiber<A>A handle to a running IO that allows for cancelation of the IO or waiting for completion. A handle to a running IO computation, providing the ability to cancel the computation or join on its result.
IOFiberTraceA synthetic StackTrace composed of IO.traced labels collected during fiber execution.
IORuntimeThe runtime environment for executing IO effects.
IOTracingConfigGlobal configuration for IO fiber tracing.
Outcome<A>Type to encode the result of an IO fiber. A fiber can complete in one of 3 ways:
PollUtility class to create unmasked blocks within an uncancelable IO region.
PQueue<A>A concurrent, fiber-safe priority queue.
Queue<A>A concurrent, fiber-safe FIFO queue.
RandomA purely functional random number generator.
RealIORuntimeThe default IORuntime implementation backed by Dart's Timer API.
Ref<A>A safe mutable reference.
Resource<A>Resource is a type that encodes the idea of performing some kind of action or allocation which in turn, requires a finalizer of some kind that must be run to clean up the allocation.
RetryDecisionRendered decision on whether or not to retry an IO based on the RetryPolicy.
RetryDetailsCurrent and cumulative retry information provided in the event of a failure.
RetryPolicyPolicy that will render decisions on whether or not to attempt to retry a failed IO.
RetryStatusCurrent status of a retry strategy. Accumulates efforts so far to retry a failed IO.
SemaphoreA purely functional semaphore for controlling concurrent access to a shared resource.
Succeeded<A>Succsseful Outcome of an IO evaluation, yielding a result.
SupervisorManages the lifecycle of fibers within a scope.

Enums

EnumDescription
FiberStateThe execution state of an IOFiber.

Extensions

ExtensiononDescription
IListConcurrencyOps<A>IList<A>
IListIOOps<A>IList<IO<A>>Operations avaiable when IList elements are of type IO.
IListResourceOps<A>IList<Resource<A>>Operations available when IList elements are of type Resource.
IOBoolOpsIO<bool>Extension providing conditional operators for boolean-yielding IOs.
IOExceptionOps<A>IO<Either<Object, A>>Extension providing operations for unpacking Either typed IOs.
IOIListOps<A>IList<A>
IONestedOps<A>IO<IO<A>>Extension methods for IO values that themselves produce an IO.
IONonEmptyIListOps<A>NonEmptyIList<A>
IOOptionOps<A>Option<A>
IOTracingOps<A>IO<A>Extension providing the traced combinator on IO.
IOTuple2Ops<T1, T2>IO<Record>Provides additional functions on an IO of a 2 element tuple.
IOTuple3Ops<T1, T2, T3>IO<Record>Provides additional functions on an IO of a 3 element tuple.
IOTuple4Ops<T1, T2, T3, T4>IO<Record>Provides additional functions on an IO of a 4 element tuple.
IOTuple5Ops<T1, T2, T3, T4, T5>IO<Record>Provides additional functions on an IO of a 5 element tuple.
IOUnitOps<A>IO<Unit>Extension on IO<Unit> to provide convenient error handling.
JoinWithUnitOpsIOFiber<Unit>Convenience extension for IOFiber<Unit> that provides a joinWithUnit method, avoiding the need to supply a fallback IO for the common Unit-typed fiber case.
NonEmptyIListIOOps<A>NonEmptyIList<IO<A>>Operations avaiable when NonEmptyIList elements are of type IO.
OptionIOOps<A>Option<IO<A>>
ResourceIListOps<A>IList<A>
ResourceIOOps<A>Resource<IO<A>>Extension on Resource wrapping an IO value, providing a convenience method to evaluate the inner effect during use.
ResourceTuple2Ops<T1, T2>Resource<Record>Provides additional functions on a Resource of a 2 element tuple.
ResourceTuple3Ops<T1, T2, T3>Resource<Record>Provides additional functions on a Resource of a 3 element tuple.
ResourceTuple4Ops<T1, T2, T3, T4>Resource<Record>Provides additional functions on a Resource of a 4 element tuple.
ResourceTuple5Ops<T1, T2, T3, T4, T5>Resource<Record>Provides additional functions on a Resource of a 5 element tuple.
RetryOps<A>IO<A>Extension provides the hook into retry capabilities for IO.
Tuple10IOOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>RecordProvides additional functions on a tuple of 10 IOs.
Tuple10ResourceOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>RecordProvides additional functions on a tuple of 10 Resources.
Tuple11IOOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>RecordProvides additional functions on a tuple of 11 IOs.
Tuple11ResourceOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>RecordProvides additional functions on a tuple of 11 Resources.
Tuple12IOOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>RecordProvides additional functions on a tuple of 12 IOs.
Tuple12ResourceOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>RecordProvides additional functions on a tuple of 12 Resources.
Tuple13IOOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>RecordProvides additional functions on a tuple of 13 IOs.
Tuple13ResourceOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>RecordProvides additional functions on a tuple of 13 Resources.
Tuple14IOOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>RecordProvides additional functions on a tuple of 14 IOs.
Tuple14ResourceOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>RecordProvides additional functions on a tuple of 14 Resources.
Tuple15IOOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>RecordProvides additional functions on a tuple of 15 IOs.
Tuple15ResourceOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>RecordProvides additional functions on a tuple of 15 Resources.
Tuple16IOOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>RecordProvides additional functions on a tuple of 16 IOs.
Tuple16ResourceOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>RecordProvides additional functions on a tuple of 16 Resources.
Tuple17IOOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>RecordProvides additional functions on a tuple of 17 IOs.
Tuple17ResourceOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>RecordProvides additional functions on a tuple of 17 Resources.
Tuple18IOOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>RecordProvides additional functions on a tuple of 18 IOs.
Tuple18ResourceOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>RecordProvides additional functions on a tuple of 18 Resources.
Tuple19IOOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>RecordProvides additional functions on a tuple of 19 IOs.
Tuple19ResourceOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>RecordProvides additional functions on a tuple of 19 Resources.
Tuple20IOOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>RecordProvides additional functions on a tuple of 20 IOs.
Tuple20ResourceOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>RecordProvides additional functions on a tuple of 20 Resources.
Tuple21IOOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>RecordProvides additional functions on a tuple of 21 IOs.
Tuple21ResourceOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>RecordProvides additional functions on a tuple of 21 Resources.
Tuple22IOOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>RecordProvides additional functions on a tuple of 22 IOs.
Tuple22ResourceOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>RecordProvides additional functions on a tuple of 22 Resources.
Tuple2IOOps<T1, T2>RecordProvides additional functions on a tuple of 2 IOs.
Tuple2ResourceOps<T1, T2>RecordProvides additional functions on a tuple of 2 Resources.
Tuple3IOOps<T1, T2, T3>RecordProvides additional functions on a tuple of 3 IOs.
Tuple3ResourceOps<T1, T2, T3>RecordProvides additional functions on a tuple of 3 Resources.
Tuple4IOOps<T1, T2, T3, T4>RecordProvides additional functions on a tuple of 4 IOs.
Tuple4ResourceOps<T1, T2, T3, T4>RecordProvides additional functions on a tuple of 4 Resources.
Tuple5IOOps<T1, T2, T3, T4, T5>RecordProvides additional functions on a tuple of 5 IOs.
Tuple5ResourceOps<T1, T2, T3, T4, T5>RecordProvides additional functions on a tuple of 5 Resources.
Tuple6IOOps<T1, T2, T3, T4, T5, T6>RecordProvides additional functions on a tuple of 6 IOs.
Tuple6ResourceOps<T1, T2, T3, T4, T5, T6>RecordProvides additional functions on a tuple of 6 Resources.
Tuple7IOOps<T1, T2, T3, T4, T5, T6, T7>RecordProvides additional functions on a tuple of 7 IOs.
Tuple7ResourceOps<T1, T2, T3, T4, T5, T6, T7>RecordProvides additional functions on a tuple of 7 Resources.
Tuple8IOOps<T1, T2, T3, T4, T5, T6, T7, T8>RecordProvides additional functions on a tuple of 8 IOs.
Tuple8ResourceOps<T1, T2, T3, T4, T5, T6, T7, T8>RecordProvides additional functions on a tuple of 8 Resources.
Tuple9IOOps<T1, T2, T3, T4, T5, T6, T7, T8, T9>RecordProvides additional functions on a tuple of 9 IOs.
Tuple9ResourceOps<T1, T2, T3, T4, T5, T6, T7, T8, T9>RecordProvides additional functions on a tuple of 9 Resources.

Typedefs

TypedefDescription
AsyncBody<A>A function that registers an AsyncCallback and triggers an asynchronous computation, used by IO.async_.
AsyncBodyWithFin<A>Like AsyncBody, but also returns an optional IO finalizer that is invoked if the resulting IO is canceled, used by IO.async.
AsyncCallback<A>A callback that receives either an error or a successfully computed value of type A, used by IO.async_.
AWon<A, B>The outcome when the IO<A> side wins a IO.racePair: the Outcome<A> of the winner together with the still-running IOFiber<B> for the loser.
BWon<A, B>The outcome when the IO<B> side wins a IO.racePair: the still-running IOFiber<A> for the loser together with the Outcome<B> of the winner.
RacePairOutcome<A, B>The result of IO.racePair: either the A-side won (AWon) or the B-side won (BWon).