# `MingaEditor.EffectScheduler.State`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga_editor/effect_scheduler/state.ex#L1)

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

# `lane`

```elixir
@type lane() :: %{
  policy: MingaEditor.Effect.Policy.t(),
  running: running() | nil,
  queue: :queue.queue(MingaEditor.Effect.Request.t())
}
```

One resource lane with a stable scheduling policy.

# `running`

```elixir
@type running() :: %{
  task: Task.t() | nil,
  request: MingaEditor.Effect.Request.t(),
  timer: reference() | nil
}
```

A running request and its supervised worker, if the worker started.

# `t`

```elixir
@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()) =&gt; lane()},
  max_admitted: pos_integer(),
  observer: pid() | nil,
  owner: pid() | nil,
  owner_monitor: reference() | nil,
  pending: %{
    optional(MingaEditor.Effect.Request.id()) =&gt; MingaEditor.Effect.Outcome.t()
  },
  task_supervisor: GenServer.server(),
  tasks: %{optional(reference()) =&gt; MingaEditor.Effect.Request.resource()},
  timers: %{optional(reference()) =&gt; MingaEditor.Effect.Request.id()}
}
```

# `new`

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

Builds initial scheduler state from validated process options.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
