(chunk: Uint8Array | string | Socket.CloseEvent)
| 563 | } |
| 564 | resume(Effect.map(Deferred.await(deferred), (ws) => { |
| 565 | const write = (chunk: Uint8Array | string | Socket.CloseEvent) => |
| 566 | Effect.sync(() => { |
| 567 | if (typeof chunk === "string") { |
| 568 | ws.sendText(chunk) |
| 569 | } else if (Socket.isCloseEvent(chunk)) { |
| 570 | ws.close(chunk.code, chunk.reason) |
| 571 | } else { |
| 572 | ws.sendBinary(chunk) |
| 573 | } |
| 574 | |
| 575 | return true |
| 576 | }) |
| 577 | const writer = Effect.succeed(write) |
| 578 | const runRaw = Effect.fnUntraced( |
| 579 | function*<R, E, _>( |