PgBackgroundWorkerHandle
Namespace: Ankus
Assembly: Ankus.Runtime.dll
Observes and controls one dynamic registration during the originating backend callback.
public sealed class PgBackgroundWorkerHandle : IDisposableDisposing this handle releases observation storage without terminating the worker. Use Terminate explicitly to request shutdown and disable future restarts.
Inheritance: object
Implements: IDisposable
Methods
Section titled “Methods”Dispose()
Section titled “Dispose()”Releases native observation storage once without terminating the worker.
public void Dispose()GetState()
Section titled “GetState()”Polls the registration’s current status and running process identifier.
public PgBackgroundWorkerState GetState()Returns: PgBackgroundWorkerState
An owned state snapshot.
Terminate()
Section titled “Terminate()”Requests worker termination and unregisters it once stopped, preventing subsequent restart.
public void Terminate()WaitForShutdown()
Section titled “WaitForShutdown()”Waits until the worker stops, or returns PostmasterDied or Untracked.
public PgBackgroundWorkerStatus WaitForShutdown()Returns: PgBackgroundWorkerStatus
The shutdown observation.
WaitForStartup()
Section titled “WaitForStartup()”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.
Properties
Section titled “Properties”NotifyProcessId
Section titled “NotifyProcessId”Gets the backend PID selected to receive transition notifications, or zero when disabled.
public int NotifyProcessId { get; }Value: int