MingaEditor.EffectScheduler.State (Minga v0.1.0)

Copy Markdown View Source

Typed process state for the editor-owned slow-effect scheduler.

Summary

Types

t()

Scheduler-owned worker identity kept outside lane values.

Functions

Builds initial scheduler state from validated process options.

Types

t()

@type t() :: %MingaEditor.EffectScheduler.State{
  admitted: MapSet.t(MingaEditor.Effect.Request.id()),
  claimed: MapSet.t(MingaEditor.Effect.Request.id()),
  lanes: %{
    optional(MingaEditor.Effect.Request.resource()) =>
      MingaEditor.EffectScheduler.Lane.t()
  },
  max_admitted: pos_integer(),
  observer: pid() | nil,
  owner: pid() | nil,
  owner_monitor: reference() | nil,
  pending: %{
    optional(MingaEditor.Effect.Request.id()) => MingaEditor.Effect.Outcome.t()
  },
  task_supervisor: GenServer.server(),
  tasks: %{optional(reference()) => task_entry()},
  timers: %{optional(reference()) => MingaEditor.Effect.Request.id()}
}

task_entry()

Scheduler-owned worker identity kept outside lane values.

Functions

new(task_supervisor, observer, max_admitted)

@spec new(GenServer.server(), pid() | nil, pos_integer()) :: t()

Builds initial scheduler state from validated process options.