MCPcopy
hub / github.com/Effect-TS/effect / handler

Function handler

packages/platform-bun/src/internal/httpServer.ts:83–94  ·  view source on GitHub ↗
(request: Request, server: BunServer)

Source from the content-addressed store, hash-verified

81 }), middleware)
82
83 function handler(request: Request, server: BunServer) {
84 return new Promise<Response>((resolve, _reject) => {
85 const fiber = runFork(Effect.provideService(
86 app,
87 ServerRequest.HttpServerRequest,
88 new ServerRequestImpl(request, resolve, removeHost(request.url), server)
89 ))
90 request.signal.addEventListener("abort", () => {
91 runFork(fiber.interruptAsFork(Error.clientAbortFiberId))
92 }, { once: true })
93 })
94 }
95
96 yield* Effect.acquireRelease(
97 Effect.sync(() => {

Callers 6

onMessageFunction · 0.70
runRawMethod · 0.70
runMethod · 0.70
onMessageFunction · 0.50
onDataFunction · 0.50
startFunction · 0.50

Calls 4

addEventListenerMethod · 0.80
removeHostFunction · 0.70
interruptAsForkMethod · 0.65
runForkFunction · 0.50

Tested by

no test coverage detected