def Context.send_with

bend-trace-context@0.2.0.0 · trace_context.bend:3765

import bend-trace-context@0.2.0.0/trace_context.bend as TraceContext
import Base

3765# Give one message that the service sends the context of a new operation,
3766# from a caller's source (see the section's introduction). `carrier` is the
3767# message's own fields; its old context fields are replaced in every case.
3768# Laws: send_operating, send_untraced and send_reports_generated.
3769def Context.send_with(~S: Type, ~read: S -> IO(S & Result<&1, &1, U32 & String, U32>), source: S, +limits: Limits,
3770  service: Service, sampling: Sampling, +policy: FailurePolicy, +carrier: List<&2, Header>) ->
3771  IO(S & FailurePolicy.result(policy, Sent)):
3772  IO.bind(S & Sent, S & FailurePolicy.result(policy, Sent),
3773    Send.run(~S, ~read, source, SendPlan.new(limits, service, sampling, carrier)),
3774    done => IO.pure(S & FailurePolicy.result(policy, Sent), Policy.apply.done(S, policy, Sent, Send.strict, done)))

Uses (19)

Used by (2)