Imp.Tracking.Session (Imp v0.5.0)

Copy Markdown View Source

Ordered, caller-owned fan-out across tracking backends.

Summary

Functions

Finishes every backend in declaration order. Failures are warnings.

Logs an event to every backend in declaration order. Failures are warnings.

Starts each backend in declaration order. A start failure aborts the session.

Types

backend_entry()

@type backend_entry() :: {module(), term()}

backend_spec()

@type backend_spec() :: module() | {module(), keyword()}

t()

@type t() :: %Imp.Tracking.Session{backends: [backend_entry()], owner: pid()}

Functions

finish(session, status \\ :finished)

@spec finish(t(), Imp.Tracking.Backend.status()) :: :ok | {:error, term()}

Finishes every backend in declaration order. Failures are warnings.

log(session, event)

@spec log(t(), Imp.Tracking.Backend.event()) :: :ok | {:error, term()}

Logs an event to every backend in declaration order. Failures are warnings.

start(backends, opts \\ [])

@spec start([backend_spec()], keyword()) :: {:ok, t()} | {:error, term()}

Starts each backend in declaration order. A start failure aborts the session.