PtcRunner.Kernel.InspectionSink (PtcRunner v0.15.0)

Copy Markdown View Source

Required owner for bounded streaming private inspection evidence.

The sink validates and deterministically encodes one record at a time, then appends its length-framed bytes to an exclusive missing-destination reservation. It retains only incremental digests, identities, counts, and limits. seal/1 appends and synchronizes the terminal footer; it never returns or retains a complete record collection.

A record emitted with digest-results capture has its value replaced by a deterministic value identity. The sink computes the identity, so an emitter sends the same message in both capture modes and enabling digest capture cannot change the emitting process's heap behaviour.

Summary

Functions

Returns a specification to start this module under a supervisor.

Seals and synchronizes the streamed artifact and returns bounded publication metadata.

Types

t()

@type t() :: %PtcRunner.Kernel.InspectionSink{pid: pid(), token: reference()}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

emit(sink, record_type, correlation, payload, opts \\ [])

@spec emit(t(), binary(), map(), map(), keyword()) ::
  :ok | {:error, :inspection_sink_error}

seal(sink)

@spec seal(t()) :: {:ok, map()} | {:error, :inspection_sink_error}

Seals and synchronizes the streamed artifact and returns bounded publication metadata.

start(opts)

@spec start(keyword()) :: {:ok, t()} | {:error, :invalid_inspection_sink}

stop(sink)

@spec stop(t()) :: :ok