Notification consumer configuration for PostgreSQL stream provider. Manages notification-based message consumption with fallback polling.

interface NotificationConsumer {
    callback: ((messages: StreamMessage[]) => void);
    consumerName: string;
    fetchInFlight?: boolean;
    fetchPending?: boolean;
    groupName: string;
    isListening: boolean;
    lastFallbackCheck: number;
    serviceInstance?: any;
    streamName: string;
}

Properties

callback: ((messages: StreamMessage[]) => void)

Callback function invoked when messages are available

consumerName: string

Unique name identifying this consumer

fetchInFlight?: boolean

True while a notification-driven fetch is in flight (coalesces concurrent NOTIFYs)

fetchPending?: boolean

Set when a NOTIFY arrives mid-fetch; triggers one follow-up fetch

groupName: string

Name of the consumer group

isListening: boolean

Whether this consumer is actively listening for notifications

lastFallbackCheck: number

Timestamp of the last fallback check (used for periodic polling)

serviceInstance?: any

Service instance that owns this consumer (for fetchAndDeliverMessages dispatch)

streamName: string

Name of the stream being consumed