| 1800 | const calls: Array<number> = [] |
| 1801 | // Its service is a Layer above the branch that stays open. |
| 1802 | class Watch extends Command.Service<Watch>()( |
| 1803 | "test/QueuedStream", |
| 1804 | { |
| 1805 | args: { n: Schema.Number }, |
| 1806 | success: Component.Noop, |
| 1807 | stream: true, |
| 1808 | mode: "queue" |
| 1809 | } |
| 1810 | ) { |
| 1811 | static readonly layer = this.toLayer(({ n }) => |
| 1812 | Stream.fromEffect(Effect.andThen( |
| 1813 | Effect.sync(() => calls.push(n)), |
| 1814 | Effect.as( |
| 1815 | n === 1 ? Deferred.await(finish) : Effect.void, |
| 1816 | Component.noop |
| 1817 | ) |
| 1818 | )) |
| 1819 | ) |
| 1820 | } |
| 1821 | const Queue = Component.define({ |
| 1822 | name: "Queue", |
| 1823 | model: Schema.Null, |
no test coverage detected