LocalEffect<A, E, Self>export type type LocalEffect<
A,
E = never,
Self = unknown
> = Effect.Effect<A, E, Local<Self>>
LocalEffect<function (type parameter) A in type LocalEffect<A, E = never, Self = unknown>A, function (type parameter) E in type LocalEffect<A, E = never, Self = unknown>E = never, function (type parameter) Self in type LocalEffect<A, E = never, Self = unknown>Self = unknown> = import EffectEffect.interface Effect<out A, out E = never, out R = never>The Effect interface defines a value that lazily describes a workflow or
job. The workflow requires some context R, and may fail with an error of
type E, or succeed with a value of type A.
When to use
Use when you need to represent a lazy, composable workflow that can require
services, fail with a typed error, or succeed with a typed value.
Details
Effect values model resourceful interaction with the outside world,
including synchronous, asynchronous, concurrent, and parallel interaction.
They use a fiber-based concurrency model, with built-in support for
scheduling, fine-grained interruption, structured concurrency, and high
scalability.
To run an Effect value, you need a Runtime, which is a type that is
capable of executing Effect values.
Effect<function (type parameter) A in type LocalEffect<A, E = never, Self = unknown>A, function (type parameter) E in type LocalEffect<A, E = never, Self = unknown>E, interface Local<in out Self>Granted only by a resource's local layer (
Hyperlink.layer
/
serve
) — never by
Hyperlink.client
. Local to this runtime's materialized impl for the tag (not a remote
client, not a peer). A
LocalMethod
carries it in its requirement channel, so calling a
non-serializable method against a client is a compile error (unsatisfied requirement); the
same call resolves when the local layer is provided. Branded by Self so one resource's local
layer can't unlock another's.
Local<function (type parameter) Self in type LocalEffect<A, E = never, Self = unknown>Self>>;