| 27 | |
| 28 | /** @internal */ |
| 29 | export class ProxySupervisor<out T> implements Supervisor.Supervisor<T> { |
| 30 | readonly [SupervisorTypeId] = supervisorVariance |
| 31 | |
| 32 | constructor( |
| 33 | readonly underlying: Supervisor.Supervisor<any>, |
| 34 | readonly value0: Effect.Effect<T> |
| 35 | ) { |
| 36 | } |
| 37 | |
| 38 | get value(): Effect.Effect<T> { |
| 39 | return this.value0 |
| 40 | } |
| 41 | |
| 42 | onStart<A, E, R>( |
| 43 | context: Context.Context<R>, |
| 44 | effect: Effect.Effect<A, E, R>, |
| 45 | parent: Option.Option<Fiber.RuntimeFiber<any, any>>, |
| 46 | fiber: Fiber.RuntimeFiber<A, E> |
| 47 | ): void { |
| 48 | this.underlying.onStart(context, effect, parent, fiber) |
| 49 | } |
| 50 | |
| 51 | onEnd<A, E>(value: Exit.Exit<A, E>, fiber: Fiber.RuntimeFiber<A, E>): void { |
| 52 | this.underlying.onEnd(value, fiber) |
| 53 | } |
| 54 | |
| 55 | onEffect<A, E>(fiber: Fiber.RuntimeFiber<A, E>, effect: Effect.Effect<any, any, any>): void { |
| 56 | this.underlying.onEffect(fiber, effect) |
| 57 | } |
| 58 | |
| 59 | onSuspend<A, E>(fiber: Fiber.RuntimeFiber<A, E>): void { |
| 60 | this.underlying.onSuspend(fiber) |
| 61 | } |
| 62 | |
| 63 | onResume<A, E>(fiber: Fiber.RuntimeFiber<A, E>): void { |
| 64 | this.underlying.onResume(fiber) |
| 65 | } |
| 66 | |
| 67 | map<B>(f: (a: T) => B): Supervisor.Supervisor<B> { |
| 68 | return new ProxySupervisor(this, pipe(this.value, core.map(f))) |
| 69 | } |
| 70 | |
| 71 | zip<B>(right: Supervisor.Supervisor<B>): Supervisor.Supervisor<[T, B]> { |
| 72 | return new Zip(this, right) |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | /** @internal */ |
| 77 | export class Zip<out T0, out T1> implements Supervisor.Supervisor<readonly [T0, T1]> { |
nothing calls this directly
no outgoing calls
no test coverage detected