MCPcopy Create free account
hub / github.com/effect-app/libs / setupRequestContextFromCurrent

Function setupRequestContextFromCurrent

packages/effect-app/src/setupRequest.ts:82–88  ·  view source on GitHub ↗
(name = "request", options?: Tracer.SpanOptions & SetupRequestOptions)

Source from the content-addressed store, hash-verified

80
81export const setupRequestContextFromCurrent =
82 (name = "request", options?: Tracer.SpanOptions & SetupRequestOptions) => <R, E, A>(self: Effect.Effect<A, E, R>) =>
83 self
84 .pipe(
85 options?.withTransaction === true ? withSqlTransaction : (_) => _,
86 withRequestSpan(name, options),
87 Effect.provide(requestStateLayer, { local: true })
88 )
89
90// Streaming variant: binds ContextMapContainer to the ambient (request) scope so its
91// finalizer (clear()) runs only after the response body is fully drained, not when the

Callers 7

query.test.tsFile · 0.90
SomethingRepoClass · 0.90
rawQuery.test.tsFile · 0.90
OrderRepoClass · 0.90
makeStoreFunction · 0.90

Calls 3

withRequestSpanFunction · 0.85
pipeMethod · 0.65
provideMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…