Follow one execution
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.
Import
import { make } from "@typed/fx/Fx";Signatures
export declare const make: <A, E = never, R = never>(run: <RSink = never>(sink: Sink<A, E, RSink>) => Effect.Effect<unknown, never, R | RSink>) => Fx<A, E, R>;Why
make is the protocol boundary for custom producers. It exposes the real Sink
operation so libraries can define cardinality, ordering, concurrency, causes, and
services without an opinionated source wrapper.
Ownership and lifetime
make stores the callback without invoking it. Calling fx.run(sink) asks the
callback to construct its Effect; executing that Effect performs the subscription.
Keep acquisition, publication, and cleanup inside the returned Effect or a required
Scope, rather than performing side effects while constructing it. The returned
Effect has no typed failure channel because producer failures are delivered through
sink.onFailure; defects and interruption can still affect the run.
Examples
import { Effect } from "effect"
import { collectAll, make } from "@typed/fx/Fx"
const pair = make<number>((sink) =>
Effect.andThen(sink.onSuccess(1), sink.onSuccess(2))
)
const program = collectAll(pair)Other public imports
These import paths expose the same declaration. Each page retains its own public name and signature.