MCPcopy Index your code
hub / github.com/Effect-TS/effect / write

Function write

packages/platform/src/Socket.ts:502–510  ·  view source on GitHub ↗
(chunk: Uint8Array | string | CloseEvent)

Source from the content-addressed store, hash-verified

500 : handler(new Uint8Array(data)), opts)
501
502 const write = (chunk: Uint8Array | string | CloseEvent) =>
503 latch.whenOpen(Effect.sync(() => {
504 const ws = currentWS!
505 if (isCloseEvent(chunk)) {
506 ws.close(chunk.code, chunk.reason)
507 } else {
508 ws.send(chunk)
509 }
510 }))
511 const writer = Effect.succeed(write)
512
513 return Effect.succeed(Socket.of({

Callers 1

emitFunction · 0.70

Calls 7

isCloseEventFunction · 0.85
getWriterFunction · 0.85
syncMethod · 0.80
encodeMethod · 0.80
closeMethod · 0.65
failMethod · 0.65
writeMethod · 0.65

Tested by

no test coverage detected