-
Notifications
You must be signed in to change notification settings - Fork 9
PgPubSubOptions
Globals / 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.
-
ClientConfig
↳ PgPubSubOptions
- acquireInterval
- application_name
- connectionString
- connectionTimeoutMillis
- database
- filtered
- host
- idle_in_transaction_session_timeout
- keepAlive
- keepAliveInitialDelayMillis
- parseInputDatesAsUTC
- password
- pgClient
- port
- query_timeout
- retryDelay
- retryLimit
- singleListener
- ssl
- statement_timeout
- stream
- user
• 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.
• Optional
application_name: undefined | string
Inherited from PgPubSubOptions.application_name
• Optional
connectionString: undefined | string
Inherited from PgPubSubOptions.connectionString
• Optional
connectionTimeoutMillis: undefined | number
Inherited from PgPubSubOptions.connectionTimeoutMillis
• Optional
database: undefined | string
Inherited from PgPubSubOptions.database
• filtered: boolean
If set to true, self emitted messages (those which were sent using
NOTIFY
on the same connection) will be filtered on this connection.
By default is false - means that connection will LISTEN
to the
messages, which were notified on the same connection.
• Optional
host: undefined | string
Inherited from PgPubSubOptions.host
• Optional
idle_in_transaction_session_timeout: undefined | number
Inherited from PgPubSubOptions.idle_in_transaction_session_timeout
• Optional
keepAlive: undefined | false | true
Inherited from PgPubSubOptions.keepAlive
• Optional
keepAliveInitialDelayMillis: undefined | number
Inherited from PgPubSubOptions.keepAliveInitialDelayMillis
• Optional
parseInputDatesAsUTC: undefined | false | true
Inherited from PgPubSubOptions.parseInputDatesAsUTC
• Optional
password: string | () => string | Promise<string>
Inherited from PgPubSubOptions.password
• Optional
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.
• Optional
port: undefined | number
Inherited from PgPubSubOptions.port
• Optional
query_timeout: undefined | number
Inherited from PgPubSubOptions.query_timeout
• retryDelay: number
Specifies delay in milliseconds between re-connection retries
• 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.
• 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.
• Optional
ssl: boolean | ConnectionOptions
Inherited from PgPubSubOptions.ssl
• Optional
statement_timeout: false | number
Inherited from PgPubSubOptions.statement_timeout
• Optional
stream: stream.Duplex
Inherited from PgPubSubOptions.stream
• Optional
user: undefined | string
Inherited from PgPubSubOptions.user