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

Function handler

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

Source from the content-addressed store, hash-verified

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

Callers 6

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

Calls 4

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

Tested by

no test coverage detected