Every public Fx constructor, combinator, function builder, interop adapter, and runner has an explicit scenario below. Aliases have their own entries and name the implementation they share. Type contracts and synchronous inspection helpers are listed separately at the end.
Read each figure as one concrete execution, not a promise of exact scheduler interleaving. Open Read this diagram below any figure for a visual key using the same shapes as its lanes: value pills, start chevrons, return bars, cause exclamation marks, and interruption crosses. Empty stretches contain no event; they do not mean the run has ended. Timed figures state their slot duration; other slots show causal order. Service, state, callback, and consumer lanes describe control activity rather than additional Fx values. Effect callback examples use serialized input unless their caption explicitly describes concurrency.
A Cause delivery and a run returning are distinct in the Fx/Sink protocol. Error examples use a terminal observer unless stated otherwise: ordinary observers stop on failure, while a custom Sink may handle a Cause and accept later values. A source that has been interrupted cannot emit the later candidate values shown in a selection example; those candidates describe what would have arrived without the bound.
Combining sources
append
Append the end value after the source run returns.
appendTick 0. No events.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The value is emitted exactly once after every source success and any delivered source failure. Interruption or a defect that prevents the source run from returning suppresses it. No resource is acquired; the source error, services, and observation lifetime are unchanged.
Source implementation · Learn the surrounding model
concat
Subscribe to live only after the cached run returns.
concatTick 0. Cached: cached; Output: cached.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Only one source is active at a time. Interruption stops the active source and prevents later acquisition. Failure is Sink delivery rather than a failing Fx.run Effect, so it does not by itself prevent the right source from being acquired.
Source implementation · Learn the surrounding model
continueWith
Invoke the continuation lazily after the current run returns, then subscribe to its result.
continueWithTick 0. Cached: cached; Output: cached.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Failures and service requirements from both producers remain on the public type and both failures are delivered to the same Sink. The returned Fx owns neither input. Interruption or a defect that prevents the first run Effect from returning also prevents the continuation from starting.
Source implementation · Learn the surrounding model
delimit
The start and end values bracket one source run.
delimitTick 0. Output: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
before is emitted once, followed by every source success or delivered source failure, then after once when the source run Effect returns. Interruption or a defect suppresses after; this is Sink sequencing, not Effect.ensuring. No resource is acquired and source requirements are kept.
Source implementation · Learn the surrounding model
merge
Both subscriptions run together; every value is forwarded and completion waits for both.
mergeTick 0. Local: local-1; Output: local-1.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Both runs are children of the consumer and completion waits for both. Downstream interruption cancels the remaining runs. A source Cause is only sent to sink.onFailure; whether that callback ends observation is Sink policy, not an intrinsic terminal rule of merge.
Source implementation · Learn the surrounding model
mergeAll
All supplied producers run concurrently; this three-source example retains every delivery.
mergeAllTick 0. Local: local-1; Output: local-1.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Typed failures from any input are forwarded and every input environment is required. Interrupt-only causes from sibling cancellation are suppressed at the Sink boundary. The observing fiber owns all concurrent runs: completion waits for all inputs, and interruption cancels the remaining runs and their resource lifetimes.
Source implementation · Learn the surrounding model
mergeLeft
The server still runs and can fail, but only local values are delivered; wait for both completions.
mergeLeftTick 0. Local: local-1; Output: local-1.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Both sources are acquired together and owned by the consuming run. Interruption cancels both and normal completion waits for both. A Cause from either source is delivered to the Sink but does not intrinsically cancel its sibling; right successes remain suppressed by the filter.
Source implementation · Learn the surrounding model
mergeOrdered
Runs multiple Fx streams concurrently while draining their values in argument order.
mergeOrderedTick 0. Second: second.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Non-interruption failures are forwarded. Interrupt-only causes mark that input ended so they cannot deadlock later buffers. All input services remain typed. The observing fiber owns all runs and buffers; completion waits for all inputs, while interruption discards buffers and interrupts remaining resource scopes.
Source implementation · Learn the surrounding model
mergeRight
Local values are suppressed while its lifetime and failures remain observable.
mergeRightTick 0. Local: local-1.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The consumer owns both concurrent runs and normal completion waits for both. Interruption cancels both. A Cause is delivered to the Sink without inherently canceling the sibling; left successes remain suppressed even while their failures are observable.
Source implementation · Learn the surrounding model
prepend
Deliver the start value before subscribing to the source.
prependTick 0. Output: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The value is emitted exactly once before the source run starts, then every source success or failure is delivered. Interruption or a defect in the Sink’s prepended-value handler prevents the source from starting. The operation acquires no resource and retains source failure, services, and lifetime.
Source implementation · Learn the surrounding model
struct
The latest-value join preserves field names rather than tuple positions.
structTick 0. Query: effect.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
It delegates concurrent ownership and retained latest values to tuple. Input failures and services are unioned, and all runs end with the consuming Fx.
Source implementation · Learn the surrounding model
tuple
Retain one latest value per input; emit a tuple after all have initialized, then on any change.
tupleTick 0. Query: effect.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
All inputs run concurrently as children of the consumer and one latest value per input is retained for that run. Failure/interruption stops the group; normal completion waits for every input.
Source implementation · Learn the surrounding model
withLatestFrom
Only source pushes trigger pairs; source-1 is dropped because state is not initialized.
withLatestFromTick 0. Source: source-1.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The right source runs in a child fiber and one latest value is retained. Left completion or consumer interruption interrupts that fiber; failure from either side is forwarded.
Source implementation · Learn the surrounding model
withLatestFromWith
The combiner runs on source pushes after state initializes; a state update alone emits nothing.
withLatestFromWithTick 0. Source: source-1.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
It inherits the child right-hand fiber and latest-value lifetime from withLatestFrom; the pure projection adds no failures, services, or resources.
Source implementation · Learn the surrounding model
zip
Wait for a fresh value from each side for each pair.
zipTick 0. Left: left-1.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Both child runs and queues belong to the consumer. The first completion, any failure, or interruption stops both fibers and discards unmatched queued values.
Source implementation · Learn the surrounding model
zipLatest
Pair current values after both initialize; either side can update the pair.
zipLatestTick 0. Query: effect.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
It delegates to tuple: both sources run concurrently and retain one latest value each until both complete or the consumer is interrupted.
Source implementation · Learn the surrounding model
zipLatestWith
Apply the combining function to each latest-value pair.
zipLatestWithTick 0. Query: effect.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Both concurrent sources and their retained latest values are owned by the consumer. The combiner is pure; failure, services, completion, and interruption come from the inputs.
Source implementation · Learn the surrounding model
zipLeft
Each fresh right value permits one left value; the right payload is discarded.
zipLeftTick 0. Left: left-1.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Both sources run concurrently. The first run to complete ends pairing and interrupts the other, while consumer interruption stops both. A failure Cause is delivered to the Sink but does not by itself end pairing; a producer may continue and supply a value afterward.
Source implementation · Learn the surrounding model
zipRight
Each fresh left value permits one right value; the left payload is discarded.
zipRightTick 0. Left: left-1.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Both runs belong to the consumer. The first completion or consumer interruption cancels the remaining run and releases the lockstep queues. Failure is Sink delivery, not an automatic stop; pairing can continue when the failing producer remains active and later emits a value.
Source implementation · Learn the surrounding model
zipWith
Apply the callback once per lockstep pair; no stale right value is reused.
zipWithTick 0. Left: left-1.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
It inherits zip’s two child runs and unbounded unmatched-value queues. The pure combiner adds no resource, error, or service requirement.
Source implementation · Learn the surrounding model
Transforming values
as
Replace every payload with the same constant without suppressing any delivery.
asTick 0. Input: a; Output: ready.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
This operation is a pure map; it acquires no resources, retains no state, and forwards source failure, completion, services, and interruption unchanged.
Source implementation · Learn the surrounding model
map
A synchronous mapping emits one transformed value for every input.
mapTick 0. Input: 1; Output: 10.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
This operation acquires no resources and retains no state. Running the result runs the source in the same Scope, and interruption or failure is forwarded unchanged.
Source implementation · Learn the surrounding model
mapEffect
Wait one turn for each mapping Effect in this serialized source. Concurrent producers can overlap callback Effects; these rows assume serial delivery.
mapEffectTick 0. Input: 1; Callback: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Each callback Effect belongs to the producer delivery that invoked it. Failure is routed to the Sink, services remain required, and interruption is local to that delivery. The combinator adds no queue, semaphore, result retention, or independent fiber.
Source implementation · Learn the surrounding model
tap
The observation Effect finishes before its original payload is forwarded. Concurrent producers can overlap callback Effects; these rows assume serial delivery.
tapTick 0. Input: 1; Callback: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Returned Effects run in the consumer path and are interrupted with it; a void callback is treated as Effect.void. Callback failures and services remain visible in the result type.
Source implementation · Learn the surrounding model
Time and rate
at
One-second slots: sleep for two seconds, emit once, then complete. Interruption during sleep would prevent ready.
atTick 0. Subscription: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Construction starts no timer. Running the Fx sleeps, emits exactly once, and completes after the sink handles the value. Interrupting the run cancels the sleep.
Source implementation · Learn the surrounding model
debounce
Emits a value only after no newer source value arrives for duration.
debounceTick 0. Input: t.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Each value starts a scoped sleep. A newer value interrupts the previous sleep and replaces its pending value, so at most the latest value is emitted after a quiet period. Source errors terminate the result. Interruption stops both source and pending timer; Scope owns those switching lifetimes.
Source implementation · Learn the surrounding model
delay
Delays every source value by duration while preserving its value and order.
delayTick 0. Input: a.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Each delivered value runs an Effect sleep before reaching the sink. Because this uses sequential effectful mapping, later values wait behind earlier sleeps and arrival order is preserved. Source failures propagate; interrupting the subscription interrupts the active sleep. No external resource is retained.
Source implementation · Learn the surrounding model
during
Forwards events only between a start signal and that signal’s first stop event.
duringTick 0. Events: before.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
events and the outer signals Fx start concurrently in one child Scope. Only the first outer value is used; that value must itself be an Fx, whose first value closes the gate. Event values before the start signal and after the stop signal are discarded. Completion of events completes the result. A failure from events, signals, or the selected stop Fx terminates everything; closing or interrupting the returned Fx interrupts all remaining fibers and closes the private Scope.
Source implementation · Learn the surrounding model
fromSchedule
Effect.schedule uses this recurrence schedule for two void deliveries, then completes; schedule outputs are not payloads.
fromScheduleTick 0. Schedule: recur; Output: void.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Construction starts no clock. Running the Fx repeatedly invokes the sink under the schedule and completes when the schedule completes. Schedule failures are forwarded as causes; interruption cancels waiting and stops further ticks. The returned Fx retains the schedule’s Error and Env channels.
Source implementation · Learn the surrounding model
groupedWithin
Partitions the stream into arrays, emitting when n is reached or duration elapses after the first element of the current group. The size must be a positive safe integer. A group can retain up to n values, so callers own the memory policy for valid sizes. Invalid sizes fail with Cause.IllegalArgumentError. Matches Effect Stream.groupedWithin.
groupedWithinTick 0. Input: a.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Each run retains at most n values and at most one timer fiber in the required Scope. A source failure is Sink delivery, so flushNow still runs afterward unless the consumer interrupts the run. Flushing or interruption cancels the timer; invalid sizes fail before subscription.
Source implementation · Learn the surrounding model
periodic
One-second slots: the first void tick follows the first period. Consumer interruption cancels future ticks.
periodicTick 0. Consumer: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Construction starts no clock. A run waits period before the first emission and again between every subsequent emission. The run fiber owns the schedule; no ticks continue after interruption.
Source implementation · Learn the surrounding model
repeat
Repeats the entire stream according to schedule after each successful completion. Failures are not repeated. Schedule.recurs(n) runs the stream n + 1 times (the original plus n repeats), matching Effect Stream.repeat.
repeatTick 0. Source: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Runs are strictly sequential. Every source value is forwarded before the Schedule is stepped with void; a successful step sleeps as configured and starts a new source run. A source failure stops immediately and is never repeated. Schedule failure is forwarded; Schedule completion ends normally. Interruption cancels the active source or schedule sleep. No runs overlap.
Source implementation · Learn the surrounding model
sample
Emits the latest source value whenever sampler emits. Source values that arrive between sampler ticks are not forwarded until the next tick. Completion: Completes when the source completes. Errors: The first failure from either stream fails the result.
sampleTick 0. Values: value-1.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
One latest-value cell and a child sampler fiber belong to each run. Source completion interrupts the sampler; any failure or consumer interruption stops both and releases the retained value.
Source implementation · Learn the surrounding model
since
Drops events until signal emits, then forwards the rest.
sinceTick 0. No events.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Event and signal runs share a child Scope. The signal observer fiber is forked but never joined: a signal failure ends that fiber and is discarded rather than delivered to the event Sink, so it does not stop events. Event completion closes the Scope; consumer interruption stops both runs.
Source implementation · Learn the surrounding model
throttle
Limits emissions to configured leading and trailing edges of fixed windows. Pass { duration, leading, trailing } for trailing or both-edge behavior. A duration alone defaults to { leading: true, trailing: false }.
throttleTick 0. Input: t; Output: t.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The first value opens a window. Leading mode emits it immediately. Values arriving while open replace one pending latest value; trailing mode emits that value when the timer closes, except that both-edge mode does not repeat the first value unless another arrived. Windows never overlap. Source errors propagate, source completion waits for the active window, and interruption stops the scoped timer and discards pending state.
Source implementation · Learn the surrounding model
timeout
Completes the stream if it does not produce a value (or complete) within duration of the previous event. Matches Effect Stream.timeout. The timeout is reset after each emission. An infinite duration is a no-op; a zero duration completes immediately.
timeoutTick 0. Source: start; Timeout: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Subscription starts the source and one scoped timer. Each delivered value forwards immediately and rearms the timer. If the timer wins, it interrupts the source and the result completes; the interrupt caused by that timeout is not forwarded. Source failure before the deadline propagates. Interruption clears both source fiber and timer. Infinite duration returns the source; zero duration never starts it.
Source implementation · Learn the surrounding model
timeoutTo
Switches to fallback if the source does not produce a value within duration of the previous event. Matches Effect Stream.timeoutOrElse and RxJS timeoutTo.
timeoutToTick 0. Source: start; Timeout: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The source and resettable timer start first. On timeout the source is interrupted, then one fallback subscription starts; the two producers never overlap. A source failure before timeout propagates and does not start the fallback. Interruption stops the active producer and timer. Infinite duration returns the source unchanged; zero duration returns the fallback without starting the source.
Source implementation · Learn the surrounding model
until
Forwards events until signal emits, then interrupts events.
untilTick 0. Events: draft; Output: draft.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Both sources start behind one gate in a private Scope. Event completion cancels the signal; signaling cancels events; failures are forwarded unless they are the expected cancellation.
Source implementation · Learn the surrounding model
Callback sources
callback
Register lazily; external callbacks fork deliveries. Consumer cancellation closes the registration scope and runs its returned cleanup Effect.
callbackTick 0. External: register; Consumer: start; Listener: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Registration is lazy: run is called once for each Fx run. The run creates a child scope and stays active until emit.done(), sink early exit, or interruption. If run returns an Effect, it is registered as the scope finalizer. Each emit operation starts its sink handler in a fiber, so handler completion can overlap; use the returned fibers or a serialized source when ordering of effects matters.
Source implementation · Learn the surrounding model
make
The custom run Effect calls the sink twice, awaits both deliveries, then returns. make itself imposes no cardinality policy.
makeTick 0. Run: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
make only stores run; it starts no work. Every call to Fx.run executes that function in the caller’s fiber. The function must keep all acquisition and cleanup inside its returned Effect or a required Scope; its error channel is never because producer failures must be sent to sink.onFailure.
Source implementation · Learn the surrounding model
Errors and recovery
catch
Exact export alias of catch_; the trace and lifecycle are identical. Recover a typed failure by running the replacement Fx; earlier values remain delivered.
catchTick 0. Source: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The source runs until it reports a Cause containing a Fail. The first typed failure starts exactly one fallback and the entire original Cause is replaced, including any defects or interrupts composed beside that Fail. A Cause with no Fail passes through unchanged. Source values already delivered remain delivered. The fallback’s services become requirements of the returned Fx, and external interruption stops whichever run is active.
Source implementation · Learn the surrounding model
catch_
Recover a typed failure by running the replacement Fx; earlier values remain delivered.
catch_Tick 0. Source: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The source runs until it reports a Cause containing a Fail. The first typed failure starts exactly one fallback and the entire original Cause is replaced, including any defects or interrupts composed beside that Fail. A Cause with no Fail passes through unchanged. Source values already delivered remain delivered. The fallback’s services become requirements of the returned Fx, and external interruption stops whichever run is active.
Source implementation · Learn the surrounding model
catchAll
Exact alias of catch_. Recover a typed failure by running the replacement Fx; earlier values remain delivered.
catchAllTick 0. Source: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
It has exactly the source/fallback switching, failure, service, and interruption semantics of catch; it allocates no wrapper resource beyond that combinator.
Source implementation · Learn the surrounding model
catchCause
Recovers from any failure cause by running a fallback Fx.
catchCauseTick 0. Source: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The handler runs once after the source reports a cause and its returned Fx continues in the same subscription. It receives the cause unchanged. Values emitted before failure are not replayed, and the fallback’s errors and services replace the recovered source error and join its requirements. Because interruption is catchable here, use this only when intentionally translating interruption rather than for ordinary typed recovery.
Source implementation · Learn the surrounding model
catchCauseIf
Recovers a failure cause only when a predicate accepts the complete cause.
catchCauseIfTick 0. Source: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The predicate receives the source cause unchanged. A match starts one lazy fallback in the same subscription; otherwise the original cause propagates. The fallback’s requirements and errors are added, prior source values stay delivered, and interrupting the returned Fx interrupts its active run.
Source implementation · Learn the surrounding model
catchIf
The predicate rejects denied, so the original typed failure is forwarded and cached never starts.
catchIfTick 0. Input: guide; Output: guide.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The predicate is evaluated on the first Fail found anywhere in the source Cause. A match starts one lazy fallback and replaces that entire Cause, including any defects or interrupts composed with the Fail. A rejection, or a Cause containing no Fail, forwards the original Cause unchanged. The fallback contributes its errors and services and shares the subscription.
Source implementation · Learn the surrounding model
catchTag
Only the Offline tag selects this fallback; its one cached value follows acquisition.
catchTagTick 0. Input: guide; Output: guide.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The source owns the subscription until its Cause contains a Fail whose tag matches. That first matching Fail starts one handler Fx and replaces the entire original Cause, including any defects or interrupts composed with it. A Cause with no Fail, or a first Fail with another tag, passes through intact. The fallback is lazy and contributes its errors and services to the result.
Source implementation · Learn the surrounding model
catchTags
This Denied failure selects the Denied handler from the handler table.
catchTagsTick 0. Input: guide; Output: guide.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The first Fail found anywhere in the source Cause is inspected. A listed tag starts exactly one handler Fx and replaces the entire original Cause, including any defects or interrupts composed with that Fail. An untagged or unlisted first Fail, or a Cause with no Fail, propagates intact. Handlers are lazy and contribute their individual errors and service requirements.
Source implementation · Learn the surrounding model
causes
Emits the source’s terminal failure cause and discards every successful value.
causesTick 0. Source: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The source is subscribed once. Success values are dropped in arrival order; a terminal cause is emitted once and the returned Fx completes without a typed error. Defects and interruption are retained inside the emitted cause. No resource is acquired beyond the source subscription.
Source implementation · Learn the surrounding model
exit
Materializes every success and the terminal failure as infallible Exit values.
exitTick 0. Source: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Each source value becomes Exit.succeed in arrival order. A source failure, including a defect or interrupt, becomes one Exit.failCause, after which the returned Fx completes with error type never. It acquires no resource beyond the single source subscription.
Source implementation · Learn the surrounding model
flip
Emits typed failures as values and fails with the first successful value.
flipTick 0. Failure: start; Success: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
If a source Cause contains any Fail, the first typed error e is delivered as success and the entire Cause is discarded, including defects or interrupts composed beside that Fail. A Cause with no Fail propagates unchanged. A source success a terminates the returned Fx with typed failure a. The source subscription is the only lifetime and external interruption still stops it.
Source implementation · Learn the surrounding model
mapBoth
Transforms both the success and error channels of an Fx using the provided options. Mirrors Effect.mapBoth: onSuccess maps emitted values, onFailure maps the typed failure (via Cause.map); defects and interrupts are preserved.
mapBothTick 0. Input: ok; Output: OK.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Both callbacks are synchronous and the operation acquires no resources. Defects, interruption, service requirements, and source lifetime pass through unchanged.
Source implementation · Learn the surrounding model
mapError
Transforms typed failures while preserving defects and interruption.
mapErrorTick 0. Source: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The mapping function runs synchronously for each Cause.Fail reported by the source. It does not run for defects or interrupts, which pass through unchanged. Values retain order and cardinality. No resource is acquired and the returned Fx has the same subscription lifetime and services as its source.
Source implementation · Learn the surrounding model
result
Materializes success and failure of an Fx as Result values. - Success: each emitted value is wrapped as Result.succeed(value). - Failure: any failure (including typed error, defect, and interrupt) is materialized as Result.fail(cause). The output error type is Cause<E>, so defects and interrupts are explicitly represented in the Result and the resulting Fx has error type never. The resulting Fx never fails at the stream level; all outcomes are emitted as Result<A, Cause<E>>. Consumers can use Result.match or Result.isSuccess / Result.isFailure to handle success vs failure (including defect/interrupt).
resultTick 0. Source: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Each source value emits one successful Result in order. A terminal cause emits one failed Result and ends normally. The source is subscribed once; no resource is acquired and an interrupt reported by the source becomes data, although interrupting the outer running fiber still stops the run.
Source implementation · Learn the surrounding model
retry
Retries the entire stream when its Cause contains a typed Fail accepted by schedule. The schedule is reset as soon as the first element of an attempt is emitted, matching Effect Stream.retry.
retryTick 0. Attempt 1: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Attempts are sequential and reuse the same downstream sink. The first Fail found anywhere in the Cause is offered to the Schedule, so a composite Cause containing that Fail can be retried even when it also contains defects or interrupts; starting a new attempt discards the whole prior Cause. A Cause without a Fail terminates immediately. Schedule completion re-emits the last source Cause, while Schedule failure terminates with its own cause. Emitting any value resets the Schedule. External interruption cancels the active attempt or backoff sleep.
Source implementation · Learn the surrounding model
Selecting values
changesWithEffect
Drops consecutive elements that are considered equal by an effectful predicate. When the effect returns true, the element is skipped; when false, it is emitted. This is the effectful variant of skipRepeatsWith: instead of a pure Equivalence<A>, you supply (prev, next) => Effect<boolean> where true means “equal” (skip) and false means “changed” (emit).
changesWithEffectTick 0. Input: received; Output: received.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
One previous value and a semaphore are scoped to each run. Comparison effects are serialized, interrupted with the run, and add their failures and services to the resulting Fx.
Source implementation · Learn the surrounding model
compact
Compacts an Fx of Options, discarding None values and unwrapping Some values.
compactTick 0. Input: Some(a); Output: a.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
This is a stateless sink transformation. It acquires no resources and forwards source failures, services, completion, and interruption unchanged.
Source implementation · Learn the surrounding model
dropAfter
Drops elements from an Fx after a predicate returns true. The element that satisfies the predicate is included in the output.
dropAfterTick 0. Input: connected; Output: connected.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The match stops upstream through the early-exit sink. The operation acquires no external resource and preserves source failures and services before completion.
Source implementation · Learn the surrounding model
dropUntil
Drops elements from an Fx until a predicate returns true. Emits from the first element for which the predicate returns true (including that element) and all following elements.
dropUntilTick 0. Input: banner.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The gate is local to one run and discarded on completion or interruption. No resources are acquired and the source’s errors and services pass through unchanged.
Source implementation · Learn the surrounding model
dropUntilEffect
Each predicate Effect takes one turn in this serialized source. Its failure is forwarded rather than treated as false. The predicate still runs after the gate opens.
dropUntilEffectTick 0. Input: banner; Predicate: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The gate is per run. Predicate effects inherit producer ordering and concurrency, are interrupted with their invoking delivery, and expose E2/R2. Failures remain observable after the gate opens.
Source implementation · Learn the surrounding model
dropWhile
Exact alias of skipWhile. Skips elements from an Fx while a predicate returns true. Emits from the first element for which the predicate returns false (including that element) and all following elements.
dropWhileTick 0. Input: banner.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
This alias has exactly skipWhile’s per-run gate and acquires no additional resource.
Source implementation · Learn the surrounding model
dropWhileEffect
Exact alias of skipWhileEffect. Each predicate Effect takes one turn in this serialized source. Its failure is forwarded rather than treated as false. The predicate still runs after the gate opens.
dropWhileEffectTick 0. Input: banner; Predicate: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
This alias retains skipWhileEffect’s failure, service, state, and interruption semantics.
Source implementation · Learn the surrounding model
filter
Filters elements of an Fx using a predicate function.
filterTick 0. Input: 1.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
No resource or buffer is acquired. The predicate runs while the source invokes the downstream sink; source failure, completion, and interruption are forwarded unchanged.
Source implementation · Learn the surrounding model
filterEffect
Admit each value only after its asynchronous even-number check succeeds. Concurrent producers can overlap callback Effects; these rows assume serial delivery.
filterEffectTick 0. Input: 1; Callback: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
A predicate Effect belongs to the producer callback that invoked it. Its Cause is sent to the Sink, R2 stays required, and interruption follows that delivery. No lock or queue is added.
Source implementation · Learn the surrounding model
filterMap
Maps and filters elements of an Fx in a single operation.
filterMapTick 0. Input: 1.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
This operation is stateless and acquires no resources. It preserves the source’s error and service channels and stops whenever the source or consuming fiber stops.
Source implementation · Learn the surrounding model
filterMapEffect
Resolve Option results asynchronously: None drops and Some unwraps. Concurrent producers can overlap callback Effects; these rows assume serial delivery.
filterMapEffectTick 0. Input: 1; Callback: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Each callback Effect follows its invoking producer delivery. Its failure Cause is sent to the Sink, services remain exposed as R2, and no semaphore, queue, or resource is added.
Source implementation · Learn the surrounding model
skip
Skips the first n elements of an Fx.
skipTick 0. Input: banner.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
A counter is local to each run and no resource is acquired. Completion, failure, services, and interruption otherwise follow the source.
Source implementation · Learn the surrounding model
skipEffect
Resolve the bound Effect before subscribing; then apply the resolved prefix or window. Acquisition failure prevents source work.
skipEffectTick 0. Bounds: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The count Effect runs once per run and can fail, require services, or be interrupted. The source is acquired only after the count succeeds.
Source implementation · Learn the surrounding model
skipRepeats
Keep the first value and drop only consecutive Effect-equal values.
skipRepeatsTick 0. Input: received; Output: received.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
One previous value is retained for each run and released when it ends. The operation owns no external resource and preserves source errors, services, and interruption.
Source implementation · Learn the surrounding model
skipRepeatsWith
Compare against the last emitted value using the supplied equivalence; a changed payload with the same id is suppressed.
skipRepeatsWithTick 0. Input: {id:a,v:1}; Output: {id:a,v:1}.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The per-run previous-value state is updated atomically and released when observation ends. The pure equivalence adds no failures or services and acquires no resource.
Source implementation · Learn the surrounding model
skipWhile
Skips elements from an Fx while a predicate returns true. Emits from the first element for which the predicate returns false (including that element) and all following elements.
skipWhileTick 0. Input: banner.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
One boolean gate is owned by each run and then discarded. No resource is acquired and source errors, services, and interruption are preserved.
Source implementation · Learn the surrounding model
skipWhileEffect
Each predicate Effect takes one turn in this serialized source. Its failure is forwarded rather than treated as false. The predicate still runs after the gate opens.
skipWhileEffectTick 0. Input: banner; Predicate: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The gate belongs to one run, while predicate invocation inherits the producer’s ordering and concurrency. Predicate failure is delivered even after the gate opened; services remain required and interruption cancels whichever callback Effects the producer attached to the run.
Source implementation · Learn the surrounding model
slice
Slices an Fx by skipping a number of elements and then taking a number of elements.
sliceTick 0. Input: banner.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Counters are local to one run. Early completion stops upstream work; otherwise source failure, services, and consumer interruption are forwarded.
Source implementation · Learn the surrounding model
sliceEffect
Resolve the bound Effect before subscribing; then apply the resolved prefix or window. Acquisition failure prevents source work.
sliceEffectTick 0. Bounds: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The bounds Effect runs once per consumer. If it fails or is interrupted the source never starts; after success, ordinary slice owns only its per-run counters.
Source implementation · Learn the surrounding model
take
Takes the first n elements from an Fx and then completes.
takeTick 0. Input: banner; Output: banner.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
A per-run counter owns no external resource. Reaching the limit interrupts/stops upstream work; source failures before that point and consumer interruption remain observable.
Source implementation · Learn the surrounding model
takeEffect
Resolve the bound Effect before subscribing; then apply the resolved prefix or window. Acquisition failure prevents source work.
takeEffectTick 0. Bounds: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The count Effect can fail, require services, or be interrupted; in those cases upstream never starts. After success, reaching the limit stops upstream work.
Source implementation · Learn the surrounding model
takeUntil
Takes elements from an Fx until a predicate returns true. The element that satisfies the predicate is not included in the output.
takeUntilTick 0. Input: connected; Output: connected.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Matching triggers the sink’s early-exit path, stopping upstream work. No resources are acquired; earlier failures and consumer interruption remain observable.
Source implementation · Learn the surrounding model
takeUntilEffect
Each predicate Effect takes one turn in this serialized source. Its failure is forwarded rather than treated as false. The boundary input is excluded and the source stops.
takeUntilEffectTick 0. Input: connected; Predicate: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Predicate effects run in the consumer and expose their failures and services. A match or interruption stops upstream and cancels active work.
Source implementation · Learn the surrounding model
takeWhile
Takes elements from an Fx while a predicate returns true. Stops at the first element for which the predicate returns false; that element is not included.
takeWhileTick 0. Input: connected; Output: connected.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
A false result stops upstream immediately. The pure predicate acquires no resources and adds no failures or services.
Source implementation · Learn the surrounding model
takeWhileEffect
Each predicate Effect takes one turn in this serialized source. Its failure is forwarded rather than treated as false. The boundary input is excluded and the source stops.
takeWhileEffectTick 0. Input: connected; Predicate: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Predicate effects expose their failures and services and are interrupted with the run. A false result stops upstream; no independent fiber or buffer is retained.
Source implementation · Learn the surrounding model
Collecting values
collectAll
Retain all successful values until the finite source completes, then return their ordered array.
collectAllTick 0. Source: a.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The array is allocated separately for each Effect run. Subscription starts when the Effect runs and ends on source completion, failure, or interruption. Every emitted value is retained until completion, so an infinite source never completes and can grow memory without bound. Failures and services remain in E and R.
Source implementation · Learn the surrounding model
collectAllFork
Return a Fiber immediately; joining it later yields the full collected array.
collectAllForkTick 0. Scope: start; Effect: Fiber.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Running the returned Effect starts a child fiber immediately. The parent fiber’s scope supervises it, so parent termination interrupts collection. The child retains every value until completion and exposes source failure as its E channel.
Source implementation · Learn the surrounding model
collectUpTo
Stop after two values and return the retained prefix; cancel remaining producer work.
collectUpToTick 0. Source: a.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Each Effect run owns a fresh array and source subscription. At most upTo values are retained in producer order; reaching the bound requests early exit and cleans up upstream. If the source completes first, the shorter array is returned. Source failures before completion remain typed.
Source implementation · Learn the surrounding model
collectUpToFork
Return a Fiber for bounded collection; the second value ends its producer and resolves its joined result.
collectUpToForkTick 0. Scope: start; Source: start; Effect: Fiber.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Running the Effect starts a supervised child immediately. It retains at most upTo values, stops upstream at the bound, and is interrupted when its parent terminates. Source failures are reported by the child fiber.
Source implementation · Learn the surrounding model
first
Resolve with Some(firstValue) and stop the source. An empty source instead returns None.
firstTick 0. No events.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Running the Effect subscribes once and stops upstream after the first value. It returns None only when the source completes first; a source failure is still E. Interruption cleans up the active source.
Source implementation · Learn the surrounding model
Concurrent work
concatMap
Maps each element to an inner Fx and concatenates the results sequentially. This scenario uses concurrent source deliveries: a pending source callback can wait for admission while another callback is already active.
concatMapTick 0. Input: a; A: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Source and inner failures are forwarded to the output Sink, and both service requirements remain in the returned type. The required Scope owns the admitted inner fiber; interruption closes it and prevents queued source work from starting. No values are dropped, switched, or replayed.
Source implementation · Learn the surrounding model
concatMapEffect
One Effect runs at a time. Every successful Effect emits exactly one result in source order. This scenario uses concurrent source deliveries: a pending source callback can wait for admission while another callback is already active.
concatMapEffectTick 0. Input: a; Save-a: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Source failures and Effect failures remain typed; callback services are added to the output requirements. The returned Fx requires Scope, which owns the active callback Effect and interrupts it when observation ends.
Source implementation · Learn the surrounding model
exhaustLatestMap
Maps each element to an inner Fx, running one now and retaining only the latest waiting value.
exhaustLatestMapTick 0. Input: a; A: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Source and admitted-inner failures are forwarded and both environments remain typed. The required Scope owns every active inner fiber. Source completion waits until the active and final pending inner finish; interruption closes the Scope and runs inner finalizers. The one-slot pending buffer retains work, not emitted output.
Source implementation · Learn the surrounding model
exhaustLatestMapEffect
b is replaced by c in the single pending slot. Active a is allowed to finish.
exhaustLatestMapEffectTick 0. Input: a; Index-a: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Source and admitted Effect failures remain typed, as do callback service requirements. The required Scope owns the active Effect; source completion drains the final pending value, while interruption discards pending work and runs active finalizers.
Source implementation · Learn the surrounding model
exhaustMap
Maps each element of an Fx to a new Fx, ignoring new elements until the current inner Fx completes.
exhaustMapTick 0. Input: a; A: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Source and admitted-inner failures are forwarded and their services remain typed. A FiberHandle in the required Scope owns the active inner. Source completion waits for that inner; interruption closes the handle and the inner’s child Scope, running its finalizers.
Source implementation · Learn the surrounding model
exhaustMapEffect
Ignore b while a is running; accept c after a completes.
exhaustMapEffectTick 0. Input: a; Submit-a: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Source and callback Effect failures remain typed and callback services are added to the output requirements. The active Effect is owned by the returned Fx’s required Scope; completion waits for it and interruption runs its finalizers.
Source implementation · Learn the surrounding model
flatMap
Maps each source value to an inner Fx and merges every inner concurrently.
flatMapTick 0. Input: a; A: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Source and inner failures are forwarded; their required services are unioned. A FiberSet in the required Scope owns all inner fibers. Source completion waits for the set to empty. Interrupting observation closes the Scope and interrupts every active inner, running each inner Scope’s finalizers.
Source implementation · Learn the surrounding model
flatMapConcurrently
Maps each element of an Fx to a new Fx, running them concurrently with a limit. This scenario uses concurrent source deliveries: a pending source callback can wait for admission while another callback is already active.
flatMapConcurrentlyTick 0. Input: a; A: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
A non-positive, fractional, infinite, or unsafe-integer limit fails through the Sink with Cause.IllegalArgumentError. Source and inner failures and services remain typed. The required Scope owns waiting and active fibers; source completion waits for all of them, and interruption cancels both groups and runs active inner finalizers.
Source implementation · Learn the surrounding model
flatMapConcurrentlyEffect
Two permits admit a and b; c waits until b releases a permit. Results follow completion order. This scenario uses concurrent source deliveries: a pending source callback can wait for admission while another callback is already active.
flatMapConcurrentlyEffectTick 0. Input: a; Load-a: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Invalid limits fail with Cause.IllegalArgumentError; source and callback failures remain typed and callback services are added to requirements. The required Scope owns waiting and active Effects. Completion drains them; interruption cancels them and runs their finalizers.
Source implementation · Learn the surrounding model
flatMapEffect
Start both Effects; b resolves first. Completion waits for outstanding a.
flatMapEffectTick 0. Input: a; Load-a: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Source and callback failures remain typed and callback services are unioned with source services. The required Scope owns all running Effects; source completion waits for them, and interruption runs every Effect finalizer.
Source implementation · Learn the surrounding model
race
Runs two streams concurrently until one emits, then mirrors the winner and interrupts the other. A failure or completion from one side before the other emits does not win unless every side ends without emitting. After a winner is chosen, that stream’s later failures are propagated.
raceTick 0. Competitors: slow+fast; Slow: start; Fast: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Before a winner, a non-interruption failure is remembered but does not win; it is reported only if both inputs end without a value. After selection, winner failures are forwarded. Both environments remain required. The observing fiber owns both child fibers and interruption cancels the race and finalizers.
Source implementation · Learn the surrounding model
raceAll
Races many streams: the first to emit wins and the rest are interrupted.
raceAllTick 0. Candidates: slow+fast+mid; Slow: start; Fast: start; Mid: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Before selection, the first non-interruption failure is retained and reported only if every input ends without emitting. After selection, winner failures are forwarded. All environments are required. Losers are interrupted and the observing fiber owns cleanup for every child.
Source implementation · Learn the surrounding model
switchMap
Maps each element of an Fx to a new Fx, and switches to the latest inner Fx. When a new element is emitted, the previous inner Fx is cancelled.
switchMapTick 0. Input: a; A: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Source and current-inner failures are forwarded and their services remain typed. The returned Fx requires Scope, which owns the current inner fiber. Source completion waits for the latest inner. Replacing or interrupting the output closes obsolete inner work and runs its scoped finalizers before the replacement proceeds.
Source implementation · Learn the surrounding model
switchMapEffect
b interrupts pending a; only b finishes and emits.
switchMapEffectTick 0. Input: a; Preview-a: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Source and current callback failures remain typed and callback services are added to requirements. The required Scope owns the current Effect. Source completion waits for it; replacement and output interruption run its finalizers before relinquishing the lifetime.
Source implementation · Learn the surrounding model
Failure sources
die
Deliver a defect Cause rather than a typed E failure.
dieTick 0. Subscription: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Construction is inert. Each run delivers one defect cause to the sink and emits no values; it acquires no resources.
Source implementation · Learn the surrounding model
fail
Deliver one typed failure Cause with no successful value.
failTick 0. Subscription: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Construction is inert. Each run delivers one typed failure cause to the sink and acquires no resources.
Source implementation · Learn the surrounding model
failCause
Forward the supplied whole Cause without dropping its combined failure or defect reasons.
failCauseTick 0. Cause: Fail(a)+Die(b); Output: cause: Fail(a)+Die(b).
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Construction is inert. Each run forwards the cause once to sink.onFailure, emits no values, and acquires no resources.
Source implementation · Learn the surrounding model
fromFailures
Consume the iterable at construction and combine its typed failures into one Cause, delivered once per run.
fromFailuresTick 0. Construction: [name,email].
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The iterable is consumed eagerly when fromFailures is called. Running the result forwards the combined cause once, emits no values, and acquires no resources. An empty iterable produces the empty Cause.
Source implementation · Learn the surrounding model
interrupt
Deliver an interruption Cause rather than a successful completion.
interruptTick 0. Subscription: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Construction is inert. Each run forwards one interruption cause carrying id to the sink, emits no values, and acquires no resources.
Source implementation · Learn the surrounding model
Running effects
drain
Run the source and discard successful payloads; the Effect completes only after source return.
drainTick 0. Source: a.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Running the Effect owns one source subscription until completion, failure, or interruption. It allocates no collection and adds no per-value effect. Source failures and services remain visible.
Source implementation · Learn the surrounding model
drainLayer
Acquire a Layer that drains values in a background fiber; closing the Layer Scope interrupts it.
drainLayerTick 0. Layer Scope: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Building the Layer starts drain(fx) with forkScoped. Acquisition succeeds after the fiber is registered; it does not wait for that fiber. The Layer scope interrupts the fiber on release. A source failure is stored in the discarded child Fiber exit: it does not fail Layer acquisition and this API exposes no handle for awaiting it. Recover, report, or otherwise observe failures inside fx before calling drainLayer, or use fork when the caller needs the Fiber exit. The annotated E channel remains in the public Layer type even though the background exit is not propagated by this implementation. Scope is supplied by the Layer.
Source implementation · Learn the surrounding model
fork
Start draining in a supervised child fiber; return its Fiber before the source finishes. Parent termination interrupts it.
forkTick 0. Scope: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The returned Effect acquires the source services and creates a child attached to the calling fiber’s scope. Parent termination interrupts the child. By default the child starts immediately and remains interruptible; options can change those two Effect fiber policies. Values are discarded and source failure is reported by the child fiber.
Source implementation · Learn the surrounding model
observe
Run the source and await observation Effects; the resulting Effect has no collected array.
observeTick 0. Source: a; Save: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Observation starts only when the returned Effect runs. That Effect owns the source run and completes when the source completes. Interruption interrupts the internal fiber and source cleanup. Callback invocation follows the producer’s delivery behavior; observe adds no buffer or concurrency of its own. A source cause or a callback failure fails the returned Effect as E | E2.
Source implementation · Learn the surrounding model
observeLayer
Layer acquisition starts background observation and returns without waiting for its exit. The Layer Scope owns interruption.
observeLayerTick 0. Layer Scope: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Building the Layer forks observe(fx, f) in its scope and completes acquisition after registration. Releasing the Layer interrupts the observer and source. Source and callback failures terminate the discarded child Fiber; they do not fail Layer acquisition, and this API exposes no Fiber handle from which to await the exit. Handle or report those failures inside the source/callback, or use observe/fork when the caller must observe them. The annotated E | E2 Layer error remains in the public type even though this implementation does not propagate the background exit. Scope is supplied internally; delivery behavior remains that of observe.
Source implementation · Learn the surrounding model
runFork
Start draining immediately at the runtime boundary and return a Fiber handle.
runForkTick 0. Call: start; Return: Fiber.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
runFork starts immediately on Effect’s default runtime, so it only accepts an Fx with no unsupplied services. The returned root fiber owns the subscription and must be interrupted by the caller when the source should stop. Values are discarded; failures appear on the fiber and RunOptions controls the runtime launch.
Source implementation · Learn the surrounding model
runPromise
Start draining at the runtime boundary; resolve after completion, or reject if it fails.
runPromiseTick 0. Call: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Calling it starts the source immediately on Effect’s default runtime, so the Fx cannot require services. The root fiber owns the subscription until completion; RunOptions controls launch and cancellation. Values are discarded. Typed failures, defects, and interruption reject according to Effect’s runPromise semantics.
Source implementation · Learn the surrounding model
runPromiseExit
Always resolve the Promise with an Exit, including a failure Exit rather than a rejected Promise.
runPromiseExitTick 0. Call: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Calling runPromiseExit starts the source immediately on Effect’s default runtime, so all services must already be eliminated. The root fiber owns the source until it completes; RunOptions can supply cancellation. Values are discarded. The Promise always resolves with an Exit, including failure and interruption.
Source implementation · Learn the surrounding model
Value sources
empty
Returns immediately with no successful delivery.
emptyTick 0. Subscription: start; Output: complete.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Each run completes synchronously, emits nothing, and acquires no resources.
Source implementation · Learn the surrounding model
fromIterable
Visit iterable elements in order, awaiting each delivery before the next.
fromIterableTick 0. Iterable: [a,b,c]; Output: a.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Construction stores the iterable but does not iterate it. Each run obtains a fresh iterator, offers values sequentially to the sink, and completes after iteration. Interruption stops further iteration. No child fiber or buffer is created.
Source implementation · Learn the surrounding model
never
No deliveries and no normal completion; the consumer interrupts the waiting run.
neverTick 0. Consumer: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Each run remains suspended until its owning fiber is interrupted. It allocates no independent timer or background fiber.
Source implementation · Learn the surrounding model
null
Exact export alias of succeedNull; the trace and lifecycle are identical. Deliver one null value and complete. This is a value pulse, distinct from empty.
nullTick 0. Subscription: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Each run performs one sink delivery and acquires no resources.
Source implementation · Learn the surrounding model
succeed
Stores a value at construction; each run delivers it once and returns.
succeedTick 0. Subscription: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Construction stores the value. Each run offers it exactly once, waits for the sink handler, and completes without acquiring resources.
Source implementation · Learn the surrounding model
succeedNull
Deliver one null value and complete. This is a value pulse, distinct from empty.
succeedNullTick 0. Subscription: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Each run performs one sink delivery and acquires no resources.
Source implementation · Learn the surrounding model
succeedUndefined
Deliver one undefined value and complete. This is a value pulse, distinct from empty.
succeedUndefinedTick 0. Subscription: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Each run performs one sink delivery and acquires no resources.
Source implementation · Learn the surrounding model
succeedVoid
Deliver one void value and complete. This is a value pulse, distinct from empty.
succeedVoidTick 0. Subscription: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Each run performs one sink delivery and acquires no resources.
Source implementation · Learn the surrounding model
suspend
Evaluate the source factory lazily for each run; then forward its selected source.
suspendTick 0. Subscription: start; Factory: choose.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
fx is not evaluated during construction. It is evaluated once per run inside Effect.suspend; thrown exceptions become Effect defects, and the returned producer is owned and interrupted as part of that same run.
Source implementation · Learn the surrounding model
sync
The thunk is evaluated anew for each run; this run reads 7.
syncTick 0. Subscription: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Construction performs no work. Each run evaluates evaluate exactly once in the run’s fiber, emits its result, and completes after the Sink handles it. A thrown exception is an Effect defect; use Fx.fromEffect(Effect.try(...)) when failure is expected and belongs in the typed error channel.
Source implementation · Learn the surrounding model
undefined
Exact export alias of succeedUndefined; the trace and lifecycle are identical. Deliver one undefined value and complete. This is a value pulse, distinct from empty.
undefinedTick 0. Subscription: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Each run performs one sink delivery and acquires no resources.
Source implementation · Learn the surrounding model
void
Exact export alias of succeedVoid; the trace and lifecycle are identical. Deliver one void value and complete. This is a value pulse, distinct from empty.
voidTick 0. Subscription: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Each run performs one sink delivery and acquires no resources.
Source implementation · Learn the surrounding model
Resource lifetime
ensuring
Run close after completion, failure, or interruption; output completion waits for cleanup.
ensuringTick 0. Source: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The finalizer runs exactly once after normal completion, failure, defect, or interruption of the source run and follows Effect’s ensuring finalization semantics. Its never typed-error channel does not make it incapable of defecting or being interrupted: a finalizer defect can fail a successful run or combine with the source Cause. Its services are required for the subscription.
Source implementation · Learn the surrounding model
onExit
Pass the actual Exit to cleanup after the run; this lane depicts a successful Exit.
onExitTick 0. Source: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The finalizer runs once after successful completion, a reported source cause, or interruption of the running fiber. The success Exit carries void because an Fx may emit many values and has no single terminal success value. A finalizer failure after normal completion is reported in the returned error channel. After a source failure or interruption it is suppressed so the already-observed termination remains authoritative. Finalizer services live for the subscription only.
Source implementation · Learn the surrounding model
onInterrupt
Runs a finalizer when the Fx reports or externally receives interruption.
onInterruptTick 0. Source: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
An interrupt-only Cause reported by the source invokes the finalizer before that Cause is delivered; finalizer failure is combined with it. External interruption of the running fiber also invokes the finalizer, suppressing its failure to preserve cancellation. Those paths are tracked separately: if an external interruption arrives while reported-Cause handling is still active, the finalizer can run once for each path. Successful and non-interrupt failures do not invoke it. A finalizer captured while constructing an Fx is shared by every run of that Fx; create mutable cleanup state lazily inside gen or genScoped when each subscription must own a distinct resource.
Source implementation · Learn the surrounding model
Stateful transforms
filterMapLoop
Loops over an Fx with an accumulator, producing an optional new value for each element. If the function returns None, the element is filtered out.
filterMapLoopTick 0. Input: a; Output: 0:a.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The seed is copied into each run and retained only until that run ends. The callback is pure, and source failure, services, completion, and interruption are preserved.
Source implementation · Learn the surrounding model
filterMapLoopCause
Loops over the failure causes of an Fx with an accumulator, potentially transforming or filtering them. This allows for complex error handling logic that maintains state across failures.
filterMapLoopCauseTick 0. Source: loaded; Source: loaded.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Failure state is isolated to one run and discarded afterward. The pure callback acquires no resources; defects and interrupts are visible inside the full Cause supplied to it.
Source implementation · Learn the surrounding model
filterMapLoopCauseEffect
Effectfully loops over the failure causes of an Fx with an accumulator.
filterMapLoopCauseEffectTick 0. Source: loaded; Source: loaded.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Cause state and callback Effects belong to the consuming run. Services remain required, callback failure is sent to the Sink, and interruption follows each delivery; no semaphore is introduced.
Source implementation · Learn the surrounding model
filterMapLoopEffect
Effectfully loops over an Fx with an accumulator, producing an optional new value.
filterMapLoopEffectTick 0. Input: a.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
One mutable seed belongs to each run. Callback Causes are delivered to the Sink, services remain required, and interruption follows each delivery; callers need a serialized producer for atomic state.
Source implementation · Learn the surrounding model
grouped
Partitions the stream into non-empty arrays of size n. The final array may be smaller if there are leftover elements. The size must be a positive safe integer. A group can retain up to n values, so callers own the memory policy for valid sizes. Invalid sizes fail with Cause.IllegalArgumentError. Matches Effect Stream.grouped.
groupedTick 0. Input: a.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Each run retains at most n values and releases its buffer after the final flush or interruption. Invalid sizes deliver failure before source acquisition. A terminal observer may interrupt before the post-failure flush, but a Sink that handles the Cause can receive the partial group afterward.
Source implementation · Learn the surrounding model
loop
Loops over an Fx with an accumulator, producing a new value for each element and updating the accumulator.
loopTick 0. Events: received; Accumulator: 1; Labels: 1.received.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
A fresh accumulator starts from seed for each run and is discarded when that run ends. The pure callback adds no failures, services, fibers, or resources.
Source implementation · Learn the surrounding model
loopCause
Loops over the failure causes of an Fx with an accumulator.
loopCauseTick 0. Source: loaded; Source: loaded.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
A fresh state begins for each run and is discarded afterward. The callback owns no resources and sees typed failures, defects, and interruption represented by Cause.
Source implementation · Learn the surrounding model
loopCauseEffect
Effectfully loops over the failure causes of an Fx with an accumulator.
loopCauseEffectTick 0. Source: loaded; Source: loaded.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
One mutable seed belongs to each run. Required services remain in the result; callback failure is delivered to the Sink, and interruption follows each producer delivery without adding a lock.
Source implementation · Learn the surrounding model
loopEffect
Effectfully loops over an Fx with an accumulator, producing a new value for each element.
loopEffectTick 0. Events: received; Accumulator: 1.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
One mutable seed is retained per run. Each callback Effect follows its invoking delivery; failure is sent to the Sink, services remain required, and interruption does not provide a global lock.
Source implementation · Learn the surrounding model
pairwise
Emits consecutive pairs [previous, current]. The first value is not emitted until a second value arrives. Equivalent to RxJS pairwise and Effect Stream.sliding(2) for pairs.
pairwiseTick 0. Input: received.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The previous-value cell belongs to one run of the returned Fx and is discarded when that run completes or is interrupted. Source errors and services are unchanged.
Source implementation · Learn the surrounding model
scan
Scans the stream with a pure function, emitting the accumulated state after each element. Emits the initial value first, then for each input a emits f(state, a) and updates state. Semantics align with Effect Stream’s scan: output is initial, f(initial, a1), f(..., a2), …
scanTick 0. Output: 100.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Each run owns an independent accumulator and releases it when the run ends. The pure reducer acquires no resources and preserves source failures, services, and interruption.
Source implementation · Learn the surrounding model
scanEffect
Scans the stream with an effectful function, emitting the accumulated state after each element. Emits the initial value first, then for each input a runs f(state, a) and emits the resulting state.
scanEffectTick 0. Output: 100.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
One mutable accumulator is owned per run. Reducer Effects inherit producer concurrency and use the captured services. Failure is delivered to the Sink without committing that transition; interruption follows the invoking callback rather than locking the entire run.
Source implementation · Learn the surrounding model
Generator composition
fn
Invoke the function to construct an Fx; its generator Effects run only when that Fx is subscribed, then its returned Fx runs.
fnTick 0. Invocation: call(id).
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Creating the function and invoking it start no stream. For generator bodies, each run evaluates the body and yielded Effects, then runs the returned Fx in the same structured lifetime. Interruption stops both acquisition and production. Direct bodies are evaluated lazily through the same unwrap boundary.
Source implementation · Learn the surrounding model
gen
Yield setup Effects once per run, then run the returned Fx. A yielded failure prevents selection.
genTick 0. Setup: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The generator is lazy: it runs for each subscription. Yielded Effects run first; only their returned Fx is then subscribed. A setup failure prevents the Fx from starting, and interruption cancels the active phase. Resources acquired by yielded Effects must not escape unless managed independently; use genScoped when setup and the returned Fx share a Scope.
Source implementation · Learn the surrounding model
genScoped
Builds an Fx with a subscription-owned Scope shared by setup and streaming.
genScopedTick 0. Setup: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Every subscription creates one child Scope, runs the generator inside it, then runs the returned Fx in the same Scope. Normal completion, failure, defect, or interruption closes the Scope and its finalizers. Setup failures prevent streaming; all non-Scope errors and services remain in the result.
Source implementation · Learn the surrounding model
unwrap
Run the Effect once per subscription and flatten the Fx it returns.
unwrapTick 0. Setup: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Acquisition and inner failures are forwarded and both environments remain in the returned type. unwrap does not create a Scope or hide one: interruption stops whichever phase is active, and any resourceful Effect or inner Fx must expose and receive its own Scope requirement.
Source implementation · Learn the surrounding model
unwrapScoped
Unwraps an Effect that produces an Fx into a single Fx, managing the scope of the effect. The scope of the effect is closed when the Fx completes or is interrupted.
unwrapScopedTick 0. Setup: start; Subscription Scope: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Acquisition and inner failures are forwarded. Non-Scope services from both phases remain required. The opened Scope owns resources acquired by both the Effect and produced Fx; it closes after normal completion, failure, or interruption, running finalizers exactly at the observation boundary.
Source implementation · Learn the surrounding model
Effect interop
fromEffect
The Effect runs once, emits its successful result, and returns. Failure instead forwards its Cause.
fromEffectTick 0. Subscription: start; Load: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Conversion is lazy. Each run executes the Effect once in the run’s fiber, forwards its success or full cause to the sink, and completes after the sink handler. The run’s interruption and scope own any acquisition performed by the Effect.
Source implementation · Learn the surrounding model
Stream interop
fromStream
Read upstream chunks and deliver each element through the Fx sink; the reader belongs to this run.
fromStreamTick 0. Stream chunks: [a,b]; Fx values: a.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Conversion starts nothing. Each Fx.run starts one Stream run owned by the caller’s fiber and scope. Interruption stops the Stream and its finalizers. Delivery order and concurrency follow Effect Stream’s mapEffect semantics and options.
Source implementation · Learn the surrounding model
toStream
Adapt push deliveries through a scoped queue for Stream consumption; this trace assumes capacity is available and the reader keeps up.
toStreamTick 0. Fx values: a.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Conversion is lazy. Running the Stream allocates the callback queue and runs the Fx; the Stream’s scope owns both. Interruption closes the callback subscription through Effect Stream’s lifecycle. Buffering follows options.
Source implementation · Learn the surrounding model
Conditional sources
if
Every condition value selects a branch and interrupts the prior active branch before forwarding replacement values.
ifTick 0. Condition: true; OnTrue: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The required Scope owns the active branch. Replacement interrupts and awaits the previous branch; consumer interruption closes active work. Failures are delivered to the Sink.
Source implementation · Learn the surrounding model
when
Conditionally emits one of two values based on the boolean value emitted by the condition stream.
whenTick 0. Condition: true.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
It delegates branch switching to if; its constant branches acquire no resources. The Scope owns scheduled branch fibers, replacement awaits their interruption, and source completion waits for the latest selected branch.
Source implementation · Learn the surrounding model
Keyed work
keyed
Efficiently transforms a list of values into a list of Fx streams, using keys to track identity. This is crucial for performance when rendering lists or managing collections of stateful entities. When the input list changes: - New keys cause onValue to be called. - Existing keys have their RefSubject updated with the new value. - Removed keys close the supplied child Scope and clean resources registered through it; the onValue run fiber remains owned by the outer parent Scope.
keyedTick 0. Collections: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Each key receives its own RefSubject and child Scope. Reusing a key updates that subject in place. Removing a key closes the child Scope and therefore the resources registered through its supplied Scope service. The onValue run fiber itself is forked in the outer parent Scope, so child-Scope closure does not guarantee interruption of an arbitrary Fx that ignores Scope. Interrupting the outer run closes the parent and remaining children. Source and onValue failures, services, and Scope requirements remain visible in the return type.
Source implementation · Learn the surrounding model
Observing failures
onError
Runs cleanup after the source reports a failure cause.
onErrorTick 0. Source: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The original cause is delivered downstream first. Cleanup runs only if that downstream onFailure Effect succeeds; if the sink itself fails or interrupts, flatMap never reaches cleanup. Typed cleanup failure is impossible by signature, but Effect.ignore does not suppress defects or interruption: either can fail or interrupt the run after the source Cause was handled. Its services are required for the subscription, and it does not run after success.
Source implementation · Learn the surrounding model
withSpan
Traces the whole subscription and each success or failure delivery.
withSpanTick 0. Source: start; Trace span: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Every run creates an Fx(name) span covering the source subscription. Each onSuccess and onFailure callback executes in its own child span. Span lifetime follows the Effects exactly; interruption closes active spans. Options are forwarded to all three span kinds, and no service requirement or failure is added beyond the configured Effect tracer.
Source implementation · Learn the surrounding model
Providing services
provide
Builds a Layer for each subscription and provides it to the entire Fx run.
provideTick 0. Service Layer: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Each subscription creates a private Scope and builds the Layer inside it before the source starts. A build failure is sent to the sink and the source never runs. Otherwise the built Context is available to every source Effect, and the Scope closes with the source’s success, failure, defect, or interruption. Provided services are removed from R; Layer dependencies and errors are added.
Source implementation · Learn the surrounding model
provideContext
Use the caller-owned context without acquiring or releasing its service instances.
provideContextTick 0. Source: start; Existing service: ready.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The Context is captured when this combinator is created and reused for each subscription. Its services are available to all source Effects and removed from R. This function does not acquire or release those service values; their owner must keep them valid for every subscription that uses the result. Source completion, failure, and interruption are unchanged.
Source implementation · Learn the surrounding model
provideService
Insert one caller-owned service instance; other requirements remain.
provideServiceTick 0. Source: start; Existing service: ready.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The service value is captured and reused for every subscription. It is not acquired or finalized here; its caller owns its lifetime. The matching service identifier is removed from R, while values, errors, ordering, and interruption remain those of the source.
Source implementation · Learn the surrounding model
provideServiceEffect
Acquires one service with an Effect before running the Fx.
provideServiceEffectTick 0. Service effect: start.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
The service Effect runs once per subscription while provide builds its Layer. A failure prevents the source from starting. On success, the service is available for the whole source run and its identifier is removed from R; acquisition errors and every requirement in R2 are added. In particular, an Effect.acquireRelease service Effect still leaves Scope.Scope in the returned Fx requirements—the private Layer Scope does not erase that public requirement. The caller must provide that Scope.
Source implementation · Learn the surrounding model
Service
Defining the service class is inert. Running it looks up the provided Fx and delegates delivery; a missing service is a defect.
ServiceTick 0. Subscription: start; Context lookup: Feed=quotes.
Read this diagram
Follow each lane from left to right. Events stacked vertically share a tick; the green cursor marks the current time across every lane.
- A value
The text inside the pill is the emitted value. - Work starts
The raised chevron starts an inner run (^in the source). - The run returns
The vertical bar ends this lane’s run. - A cause is delivered
The exclamation mark belongs to this lane. - Work is interrupted
The cross marks cancellation of this run. - Current time
The line and diamond move together across all lanes. - Happening now
A highlighted event is at the current tick. - Still ahead
Muted, dashed values have not happened yet. - Time continues
The lane’s arrow is not a return marker. An empty stretch can be quiet work that is still running.
Illustrated ticks start at 0. At 1×, one illustrated tick takes one second; captions specify real durations when timing matters. A cause or interruption belongs to its lane, and other work may continue. Scroll horizontally to inspect the rest of a long timeline.
Defining the class starts no work. Class.make acquires the producer when its layer is built, supplies the acquisition context to it, and binds its lifetime to the layer scope. Running the class reads the currently installed implementation.
Source implementation · Learn the surrounding model
Non-temporal exports
These exports do not create or transform an execution timeline. Nested Fx and fn namespace members are type contracts covered by their parent namespace; they do not hide additional operators.
-
FlatMapLike — Type-level contract; no subscription or emissions. Source
-
FlatMapEffectLike — Type-level contract; no subscription or emissions. Source
-
KeyedOptions — Type-level contract; no subscription or emissions. Source
-
Bounds — Type-level contract; no subscription or emissions. Source
-
ThrottleOptions — Type-level contract; no subscription or emissions. Source
-
Emit — Type-level contract; no subscription or emissions. Source
-
Fx — Type-level contract; no subscription or emissions. Source
-
Success — Type-level contract; no subscription or emissions. Source
-
Error — Type-level contract; no subscription or emissions. Source
-
Services — Type-level contract; no subscription or emissions. Source
-
ToStreamOptions — Type-level contract; no subscription or emissions. Source
-
FromStreamOptions — Type-level contract; no subscription or emissions. Source
-
FxTypeId — Brand symbol and its associated type; no subscription or emissions. Source
-
isFx — Synchronous brand guard; inspects a value and starts no subscription. Source