Hyperlinkv0.8.0-beta.28

Channel

Channel.withSpanconsteffect/Channel.ts:7410
(name: string, options?: SpanOptions): <
  OutElem,
  OutErr,
  OutDone,
  InElem,
  InErr,
  InDone,
  R
>(
  self: Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, R>
) => Channel<
  OutElem,
  InElem,
  OutErr,
  InErr,
  OutDone,
  InDone,
  Exclude<R, ParentSpan>
>
<OutElem, OutErr, OutDone, InElem, InErr, InDone, R>(
  self: Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, R>,
  name: string,
  options?: SpanOptions
): Channel<
  OutElem,
  InElem,
  OutErr,
  InErr,
  OutDone,
  InDone,
  Exclude<R, ParentSpan>
>

Runs the channel inside a tracing span with the specified name and options.

Details

The created span is provided as the current parent span while the channel runs. The span is ended with the channel's exit value.

tracing
Source effect/Channel.ts:741022 lines
export const withSpan: {
  (
    name: string,
    options?: SpanOptions
  ): <OutElem, OutErr, OutDone, InElem, InErr, InDone, R>(
    self: Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, R>
  ) => Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Exclude<R, ParentSpan>>
  <OutElem, OutErr, OutDone, InElem, InErr, InDone, R>(
    self: Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, R>,
    name: string,
    options?: SpanOptions
  ): Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Exclude<R, ParentSpan>>
} = function() {
  const dataFirst = isChannel(arguments[0])
  const name = dataFirst ? arguments[1] : arguments[0]
  const options = addSpanStackTrace(dataFirst ? arguments[2] : arguments[1])
  if (dataFirst) {
    const self = arguments[0]
    return withSpanImpl(self, name, options)
  }
  return (self: any) => withSpanImpl(self, name, options)
} as any
Referenced by 1 symbols