Minga.Extension.Instance.StartContext (Minga v0.1.0)

Copy Markdown View Source

Phase-owned state for one extension start transition.

Summary

Functions

Records the bounded worker performing the transition.

Clears completed or failed worker bookkeeping.

Adds a caller waiting for the in-flight start.

Starts a transition with its callers and previous phase.

Queues a stop caller behind the in-flight start.

Clears runtime and worker ownership after the runtime exits during start.

Records the runtime started by the transition.

Types

t()

@type t() :: %Minga.Extension.Instance.StartContext{
  previous: term(),
  runtime: Minga.Extension.Instance.Runtime.t() | nil,
  stop_waiters: [GenServer.from()],
  waiters: [GenServer.from()],
  worker: Minga.Extension.Instance.Worker.t() | nil
}

Functions

begin_work(context, worker)

@spec begin_work(t(), Minga.Extension.Instance.Worker.t()) :: t()

Records the bounded worker performing the transition.

finish_work(context)

@spec finish_work(t()) :: t()

Clears completed or failed worker bookkeeping.

join(context, from)

@spec join(t(), GenServer.from()) :: t()

Adds a caller waiting for the in-flight start.

new(waiters, previous)

@spec new([GenServer.from()], term()) :: t()

Starts a transition with its callers and previous phase.

queue_stop(context, from)

@spec queue_stop(t(), GenServer.from()) :: t()

Queues a stop caller behind the in-flight start.

runtime_exited(context)

@spec runtime_exited(t()) :: t()

Clears runtime and worker ownership after the runtime exits during start.

runtime_started(context, runtime)

@spec runtime_started(t(), Minga.Extension.Instance.Runtime.t()) :: t()

Records the runtime started by the transition.