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

Class Const

packages/effect/src/internal/supervisor.ts:185–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183
184/** @internal */
185export class Const<out T> implements Supervisor.Supervisor<T> {
186 readonly [SupervisorTypeId] = supervisorVariance
187
188 constructor(readonly effect: Effect.Effect<T>) {
189 }
190
191 get value(): Effect.Effect<T> {
192 return this.effect
193 }
194
195 onStart<A, E, R>(
196 _context: Context.Context<R>,
197 _effect: Effect.Effect<A, E, R>,
198 _parent: Option.Option<Fiber.RuntimeFiber<any, any>>,
199 _fiber: Fiber.RuntimeFiber<A, E>
200 ): void {
201 //
202 }
203
204 onEnd<A, E>(_value: Exit.Exit<A, E>, _fiber: Fiber.RuntimeFiber<A, E>): void {
205 //
206 }
207
208 onEffect<A, E>(_fiber: Fiber.RuntimeFiber<A, E>, _effect: Effect.Effect<any, any, any>): void {
209 //
210 }
211
212 onSuspend<A, E>(_fiber: Fiber.RuntimeFiber<A, E>): void {
213 //
214 }
215
216 onResume<A, E>(_fiber: Fiber.RuntimeFiber<A, E>): void {
217 //
218 }
219
220 map<B>(f: (a: T) => B): Supervisor.Supervisor<B> {
221 return new ProxySupervisor(this, pipe(this.value, core.map(f)))
222 }
223
224 zip<A>(right: Supervisor.Supervisor<A>): Supervisor.Supervisor<[T, A]> {
225 return new Zip(this, right)
226 }
227
228 onRun<E, A, X>(execution: () => X, _fiber: Fiber.RuntimeFiber<A, E>): X {
229 return execution()
230 }
231}
232
233class FibersIn implements Supervisor.Supervisor<SortedSet.SortedSet<Fiber.RuntimeFiber<any, any>>> {
234 readonly [SupervisorTypeId] = supervisorVariance

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected