Skip to content

PgBackgroundWorkerOptions

Namespace: Ankus

Assembly: Ankus.Runtime.dll

Describes an independently registered PostgreSQL background-worker process.

public sealed class PgBackgroundWorkerOptions

Inheritance: object

PgBackgroundWorkerOptions(string, string, string)

Section titled “PgBackgroundWorkerOptions(string, string, string)”

Describes an independently registered PostgreSQL background-worker process.

public PgBackgroundWorkerOptions(string name, string library, string entryPoint)

Parameters:

name — string

The worker’s display name.

library — string

The PostgreSQL library containing the native entry.

entryPoint — string

The exact exported native entry symbol.

Gets the exact by-value native Datum word delivered to the entry.

public nuint Argument { get; init; }

Value: nuint

Gets whether the worker may initialize a database connection.

public bool DatabaseAccess { get; init; }

Value: bool

Gets the exact native entry symbol.

public string EntryPoint { get; }

Value: string

Gets optional UTF-8 text copied into the worker’s fixed extra-data field.

public string Extra { get; init; }

Value: string

Gets the PostgreSQL library name or path.

public string Library { get; }

Value: string

Gets the worker’s display name.

public string Name { get; }

Value: string

Gets the backend PID to notify when a dynamic worker starts or stops; zero disables notifications.

public int NotifyProcessId { get; init; }

Value: int

Set this to the registering backend’s PID when waiting for startup or shutdown. Static workers require zero.

Gets the delay before restarting a failed worker, or null to disable automatic restart.

public TimeSpan? RestartDelay { get; init; }

Value: TimeSpan?

PostgreSQL accepts whole seconds. Zero requests immediate restart; successful exits do not restart.

Gets the startup phase, defaulting to recovery completion for database workers and postmaster start otherwise.

public PgBackgroundWorkerStartTime StartTime { get; init; }

Value: PgBackgroundWorkerStartTime

Gets the worker type reported by PostgreSQL, defaulting to its name.

public string Type { get; init; }

Value: string