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

Function traced

packages/effect/src/ui/Query.ts:5299–5315  ·  view source on GitHub ↗
(
    def: QueryDef,
    trigger: Trigger,
    body: () => Effect.Effect<A, E>,
    parent: queryCore.SpanContext | "caller" | undefined
  )

Source from the content-addressed store, hash-verified

5297 * `"caller"`; otherwise it starts its own trace, since the cache's context is the mount's.
5298 */
5299 const traced = <A, E>(
5300 def: QueryDef,
5301 trigger: Trigger,
5302 body: () => Effect.Effect<A, E>,
5303 parent: queryCore.SpanContext | "caller" | undefined
5304 ): Effect.Effect<A, E> =>
5305 Effect.useSpan(
5306 def.name,
5307 parent === "caller"
5308 ? { attributes: { trigger } }
5309 : {
5310 attributes: { trigger },
5311 parent: parent && Tracer.externalSpan(parent),
5312 root: true
5313 },
5314 (span) => Effect.provideService(body(), Tracer.ParentSpan, span)
5315 )
5316 /** Runs `f` one scheduler step later. */
5317 const defer = (f: () => void): void => {
5318 runFork(

Callers 3

startFetchFunction · 0.70
runSharedFunction · 0.70
getFunction · 0.70

Calls 1

bodyFunction · 0.50

Tested by

no test coverage detected