( self: Fiber.Fiber<A, E> )
| 764 | |
| 765 | /** @internal */ |
| 766 | export const fiberAwait = <A, E>( |
| 767 | self: Fiber.Fiber<A, E> |
| 768 | ): Effect.Effect<Exit.Exit<A, E>> => { |
| 769 | const impl = self as FiberImpl<A, E> |
| 770 | if (impl._exit) return succeed(impl._exit) |
| 771 | return callback((resume) => { |
| 772 | if (impl._exit) return resume(succeed(impl._exit)) |
| 773 | return sync(self.addObserver((exit) => resume(succeed(exit)))) |
| 774 | }) |
| 775 | } |
| 776 | |
| 777 | /** @internal */ |
| 778 | export const fiberAwaitAll = <Fiber extends Fiber.Fiber<any, any>>( |