MCPcopy Create free account
hub / github.com/Effect-TS/effect / Supervisor

Interface Supervisor

packages/effect/src/Supervisor.ts:36–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34 * @category models
35 */
36export interface Supervisor<out T> extends Supervisor.Variance<T> {
37 /**
38 * Returns an `Effect` that succeeds with the value produced by this
39 * supervisor. This value may change over time, reflecting what the supervisor
40 * produces as it supervises fibers.
41 */
42 readonly value: Effect.Effect<T>
43
44 /**
45 * Supervises the start of a `Fiber`.
46 */
47 onStart<A, E, R>(
48 context: Context.Context<R>,
49 effect: Effect.Effect<A, E, R>,
50 parent: Option.Option<Fiber.RuntimeFiber<any, any>>,
51 fiber: Fiber.RuntimeFiber<A, E>
52 ): void
53
54 /**
55 * Supervises the end of a `Fiber`.
56 */
57 onEnd<A, E>(value: Exit.Exit<A, E>, fiber: Fiber.RuntimeFiber<A, E>): void
58
59 /**
60 * Supervises the execution of an `Effect` by a `Fiber`.
61 */
62 onEffect<A, E>(fiber: Fiber.RuntimeFiber<A, E>, effect: Effect.Effect<any, any, any>): void
63
64 /**
65 * Supervises the suspension of a computation running within a `Fiber`.
66 */
67 onSuspend<A, E>(fiber: Fiber.RuntimeFiber<A, E>): void
68
69 /**
70 * Supervises the resumption of a computation running within a `Fiber`.
71 */
72 onResume<A, E>(fiber: Fiber.RuntimeFiber<A, E>): void
73
74 /**
75 * Maps this supervisor to another one, which has the same effect, but whose
76 * value has been transformed by the specified function.
77 */
78 map<B>(f: (a: T) => B): Supervisor<B>
79
80 /**
81 * Returns a new supervisor that performs the function of this supervisor, and
82 * the function of the specified supervisor, producing a tuple of the outputs
83 * produced by both supervisors.
84 */
85 zip<A>(right: Supervisor<A>): Supervisor<[T, A]>
86}
87
88/**
89 * @since 2.0.0

Callers 36

lifecycle.test.tsFile · 0.65
unsafeMakeChildFiberFunction · 0.65
onStartMethod · 0.65
onStartMethod · 0.65
runtime.tsFile · 0.65
lifecycle.test.tsFile · 0.65
unsafeMakeChildFiberFunction · 0.65
onEndMethod · 0.65
onEndMethod · 0.65
runtime.tsFile · 0.65
runLoopMethod · 0.65
onEffectMethod · 0.65

Implementers 5

ProxySupervisorpackages/effect/src/internal/superviso
Zippackages/effect/src/internal/superviso
Trackpackages/effect/src/internal/superviso
Constpackages/effect/src/internal/superviso
FibersInpackages/effect/src/internal/superviso

Calls

no outgoing calls

Tested by

no test coverage detected