Finalizes Editor-owned work and presentation for one contribution source.
Extension cleanup requests this workflow asynchronously and waits for an explicit Editor acknowledgement outside the lifecycle authority mailbox. The generation-owned effect scheduler drains before source presentation is removed.
Summary
Functions
Registers the Editor finalizer with source-owned contribution cleanup.
Cancels source work before removing its live picker presentation.
Schedules source-filtered unload callbacks and defers the cleanup acknowledgement.
Runs token-scoped unload callbacks against the production Editor, if it is running.
Finalizes a source against the production Editor, if it is running.
Finalizes a source against an explicit Editor server.
Types
@type result() :: :ok | {:error, term()}
@type source() :: Minga.Extension.ContributionCleanup.contribution_source()
@type unload_context() :: %{ :token => Minga.Extension.CodeLease.unload_token(), optional(:callback_registry) => Minga.Extension.CallbackRegistry.registry(), optional(:callback_admission) => GenServer.server() }
Functions
@spec ensure_cleanup_registered() :: :ok
Registers the Editor finalizer with source-owned contribution cleanup.
@spec finalize(MingaEditor.State.t(), source()) :: {result(), MingaEditor.State.t()}
Cancels source work before removing its live picker presentation.
@spec finalize_unload( MingaEditor.State.t(), Minga.Extension.CallbackInvoker.source(), unload_context(), {pid(), reference()} ) :: {:ok, MingaEditor.State.t()} | {:error, term(), MingaEditor.State.t()}
Schedules source-filtered unload callbacks and defers the cleanup acknowledgement.
@spec unload_source(Minga.Extension.CallbackInvoker.source(), unload_context()) :: result()
Runs token-scoped unload callbacks against the production Editor, if it is running.
Finalizes a source against the production Editor, if it is running.
@spec unregister_source(source(), GenServer.server() | nil) :: result()
Finalizes a source against an explicit Editor server.