MCPcopy Create free account
hub / github.com/Effect-TS/effect / arrayBuffer

Method arrayBuffer

packages/platform/bun/src/BunHttpServer.ts:519–537  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

517
518 private arrayBufferEffect: Effect.Effect<ArrayBuffer, Error.HttpServerError> | undefined
519 get arrayBuffer(): Effect.Effect<ArrayBuffer, Error.HttpServerError> {
520 if (this.arrayBufferEffect) {
521 return this.arrayBufferEffect
522 }
523 this.arrayBufferEffect = Effect.runSync(Effect.cached(
524 Effect.tryPromise({
525 try: () => this.source.arrayBuffer(),
526 catch: (cause) =>
527 new Error.HttpServerError({
528 reason: new Error.RequestParseError({
529 request: this,
530 cause
531 })
532 })
533 })
534 ))
535 this.textEffect = Effect.map(this.arrayBufferEffect, (_) => new TextDecoder().decode(_))
536 return this.arrayBufferEffect
537 }
538
539 get upgrade(): Effect.Effect<Socket.Socket, Error.HttpServerError> {
540 return Effect.callback<Socket.Socket, Error.HttpServerError>((resume) => {

Callers 1

Calls 1

mapMethod · 0.45

Tested by

no test coverage detected