Skip to content

PgBackgroundWorkerHandle

Namespace: Ankus

Assembly: Ankus.Runtime.dll

Observes and controls one dynamic registration during the originating backend callback.

public sealed class PgBackgroundWorkerHandle : IDisposable

Disposing this handle releases observation storage without terminating the worker. Use Terminate explicitly to request shutdown and disable future restarts.

Inheritance: object

Implements: IDisposable

Releases native observation storage once without terminating the worker.

public void Dispose()

Polls the registration’s current status and running process identifier.

public PgBackgroundWorkerState GetState()

Returns: PgBackgroundWorkerState

An owned state snapshot.

Requests worker termination and unregisters it once stopped, preventing subsequent restart.

public void Terminate()

Waits until the worker stops, or returns PostmasterDied or Untracked.

public PgBackgroundWorkerStatus WaitForShutdown()

Returns: PgBackgroundWorkerStatus

The shutdown observation.

Waits for the postmaster to attempt startup, or returns Untracked if this backend is not the notifier.

public PgBackgroundWorkerState WaitForStartup()

Returns: PgBackgroundWorkerState

The observed startup outcome.

Gets the backend PID selected to receive transition notifications, or zero when disabled.

public int NotifyProcessId { get; }

Value: int