MingaAgent.Session.SubscriberAttachment (Minga v0.1.0)

Copy Markdown View Source

Canonical identity for one process attached to an agent session.

The role and monitor reference travel with the PID so subscriber membership cannot exist without its OTP monitor identity.

Summary

Types

Remote attachment role.

t()

Functions

Assigns a new role while preserving subscriber and monitor identity.

Builds a monitored subscriber attachment.

Types

role()

@type role() :: :driver | :viewer

Remote attachment role.

t()

@type t() :: %MingaAgent.Session.SubscriberAttachment{
  monitor_ref: reference(),
  pid: pid(),
  role: role()
}

Functions

assign_role(attachment, role)

@spec assign_role(t(), role()) :: t()

Assigns a new role while preserving subscriber and monitor identity.

new(pid, role, monitor_ref)

@spec new(pid(), role(), reference()) :: t()

Builds a monitored subscriber attachment.