Editor-generation-owned process wrapper for bounded slow effects.
Work is serialized by stable resource identity while unrelated resources run
concurrently. Lifecycle, policy, admission, and worker transitions live in
MingaEditor.EffectScheduler.Engine.
Summary
Types
Scheduler server reference.
Functions
Returns whether the scheduler has running or queued work for a domain handler.
Returns whether any queued, running, or pending request advertises an activity.
Returns whether a source has queued, running, or pending work.
Returns whether an exact request still holds scheduler admission.
Attaches the single Editor owner for this scheduler generation.
Cancels an admitted request by id.
Cancels the admitted request correlated with a semantic operation.
Cancels queued, running, and pending work for a semantic resource.
Cancels queued, running, and pending work attributed to a source.
Returns a specification to start this module under a supervisor.
Claims a still-current candidate before its domain handler applies it.
Finalizes the domain-applied terminal outcome exactly once.
Atomically finalizes one candidate and admits its typed follow-up request.
Admits a typed effect request under its declared bounded policy.
Starts an effect scheduler.
Returns bounded scheduler statistics without exposing queued payloads.
Types
@type admission() :: MingaEditor.EffectScheduler.Engine.admission()
@type admission_error() :: MingaEditor.EffectScheduler.Engine.admission_error()
@type cancel_error() :: :not_found | :scheduler_unavailable
@type claim() :: MingaEditor.EffectScheduler.Engine.claim()
@type handoff() :: MingaEditor.EffectScheduler.Engine.handoff()
@type server() :: GenServer.server()
Scheduler server reference.
@type source() :: Minga.Extension.ContributionCleanup.contribution_source()
Functions
Returns whether the scheduler has running or queued work for a domain handler.
Returns whether any queued, running, or pending request advertises an activity.
Returns whether a source has queued, running, or pending work.
@spec admitted?(server() | nil, MingaEditor.Effect.Request.id()) :: boolean()
Returns whether an exact request still holds scheduler admission.
Attaches the single Editor owner for this scheduler generation.
@spec cancel(server(), MingaEditor.Effect.Request.id()) :: :ok | {:error, :not_found}
Cancels an admitted request by id.
@spec cancel_operation(server() | nil, MingaEditor.State.Operation.id()) :: :ok | {:error, cancel_error()}
Cancels the admitted request correlated with a semantic operation.
@spec cancel_resource(server() | nil, MingaEditor.Effect.Request.resource()) :: :ok | {:error, :scheduler_unavailable}
Cancels queued, running, and pending work for a semantic resource.
Cancels queued, running, and pending work attributed to a source.
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec claim(server(), MingaEditor.Effect.Outcome.t()) :: claim()
Claims a still-current candidate before its domain handler applies it.
@spec finalize(server(), MingaEditor.Effect.Outcome.t()) :: :ok
Finalizes the domain-applied terminal outcome exactly once.
@spec finalize_and_schedule( server(), MingaEditor.Effect.Outcome.t(), MingaEditor.Effect.Request.t() ) :: handoff()
Atomically finalizes one candidate and admits its typed follow-up request.
@spec schedule(server(), MingaEditor.Effect.Request.t()) :: admission()
Admits a typed effect request under its declared bounded policy.
@spec start_link(keyword()) :: GenServer.on_start()
Starts an effect scheduler.
@spec stats(server()) :: %{ resources: non_neg_integer(), running: non_neg_integer(), queued: non_neg_integer(), pending: non_neg_integer(), admitted: non_neg_integer(), capacity: pos_integer() }
Returns bounded scheduler statistics without exposing queued payloads.