()
| 449 | } |
| 450 | |
| 451 | get await(): Effect.Effect<Exit.Exit<A, E>> { |
| 452 | return core.async((resume) => { |
| 453 | const cb = (exit: Exit.Exit<A, E>) => resume(core.succeed(exit)) |
| 454 | if (this._exitValue !== null) { |
| 455 | cb(this._exitValue!) |
| 456 | return |
| 457 | } |
| 458 | this.tell( |
| 459 | FiberMessage.stateful((fiber, _) => { |
| 460 | if (fiber._exitValue !== null) { |
| 461 | cb(this._exitValue!) |
| 462 | } else { |
| 463 | fiber.addObserver(cb) |
| 464 | } |
| 465 | }) |
| 466 | ) |
| 467 | return core.sync(() => |
| 468 | this.tell( |
| 469 | FiberMessage.stateful((fiber, _) => { |
| 470 | fiber.removeObserver(cb) |
| 471 | }) |
| 472 | ) |
| 473 | ) |
| 474 | }, this.id()) |
| 475 | } |
| 476 | |
| 477 | get inheritAll(): Effect.Effect<void> { |
| 478 | return core.withFiberRuntime((parentFiber, parentStatus) => { |
no test coverage detected