Skip to content

PgPubSubOptions

Mykhailo Stadnyk edited this page Jan 2, 2020 · 5 revisions

Interface: PgPubSubOptions

Options accepted as option argument of PgPubSub constructor. It extends pg.ClientConfig options, mostly because it is used to construct PostgreSQL database connection, adding more properties required to configure PgBubSub objects behavior.

Hierarchy

  • ClientConfig

    PgPubSubOptions

Index

Properties

Properties

acquireInterval

acquireInterval: number

Time interval in milliseconds before LISTEN clients would re-try to acquire channel locks. It works from one hand as connection keep-alive periodical pings, from other hand adds additional level of reliability for the cases when connection, which holds the lock has been suddenly disconnected in a silent manner.

By default is set to 30000ms (30sec). Please, assume this value should be selected for a particular system with care of often acquire lock hits and overall infrastructure reliability.

type {number}


Optional connectionString

connectionString? : undefined | string

Inherited from void


Optional database

database? : undefined | string

Inherited from void


filtered

filtered: boolean

If set to true, self emitted messages will be filtered on the connection. By default is false.

type {boolean}


Optional host

host? : undefined | string

Inherited from void


Optional keepAlive

keepAlive? : undefined | false | true

Inherited from void


Optional keepAliveInitialDelayMillis

keepAliveInitialDelayMillis? : undefined | number

Inherited from void


Optional password

password? : undefined | string

Inherited from void


Optional pgClient

pgClient? : Client

Existing PostgreSQL client connection (optional). Can be passed if there is a need to re-use existing db connection from external code. Otherwise it is required to bypass correct options to instantiate new pg.Client connection properly.

type {Client}


Optional port

port? : undefined | number

Inherited from void


Optional query_timeout

query_timeout? : undefined | number

Inherited from void


retryDelay

retryDelay: number

Specifies delay in milliseconds between re-connection retries

type {number}


retryLimit

retryLimit: number

Specifies maximum number of re-connection retries to process, before connection would be treated as broken (disconnected). By default is set to infinite number of retries.

type {number}


singleListener

singleListener: boolean

Boolean flag, which turns off/on single listener mode. By default is set to true, so instantiated PgPubSub connections will act using inter-process locking mechanism.

type {boolean}


Optional ssl

ssl? : boolean | ConnectionOptions

Inherited from void


Optional statement_timeout

statement_timeout? : false | number

Inherited from void


Optional stream

stream? : stream.Duplex

Inherited from void


Optional user

user? : undefined | string

Inherited from void

Clone this wiki locally