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

Function call

packages/effect/test/rpc/RpcClient.test.ts:1688–1703  ·  view source on GitHub ↗
(
      method: "Ping" | "Events",
      options: { spanPrefix?: string; spanAttributes?: Record<string, unknown> } = {}
    )

Source from the content-addressed store, hash-verified

1686 const SpanGroup = TestGroup.prefix("Echo.")
1687
1688 const call = (
1689 method: "Ping" | "Events",
1690 options: { spanPrefix?: string; spanAttributes?: Record<string, unknown> } = {}
1691 ) =>
1692 withCapturedSpans((spans) =>
1693 Effect.gen(function*() {
1694 const client = yield* RpcTest.makeClient(SpanGroup, options)
1695 yield* method === "Ping" ? client["Echo.Ping"]() : Stream.runDrain(client["Echo.Events"]())
1696 return spans
1697 }).pipe(
1698 Effect.provide(SpanGroup.toLayer({
1699 "Echo.Ping": () => Effect.succeed("pong"),
1700 "Echo.Events": () => Stream.make("event")
1701 }))
1702 )
1703 )
1704
1705 it.effect("records RPC span defaults for streaming calls", () =>
1706 Effect.gen(function*() {

Callers 1

RpcClient.test.tsFile · 0.70

Calls 6

withCapturedSpansFunction · 0.70
pipeMethod · 0.65
toLayerMethod · 0.65
makeMethod · 0.65
provideMethod · 0.45
succeedMethod · 0.45

Tested by

no test coverage detected