Skip to content
Mykhailo Stadnyk edited this page Dec 30, 2019 · 28 revisions

@imqueue/pg-pubsub - v1.2.4

Index

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

Type aliases

AnyJson

Ƭ AnyJson: boolean | number | string | null | JsonArray | JsonMap

Defined in src/types/AnyJson.ts:19

Represents any JSON-serializable value

Variables

Const ACQUIRE_INTERVAL

ACQUIRE_INTERVAL: 30000 = 30000

Defined in src/constants.ts:21


Const IS_ONE_PROCESS

IS_ONE_PROCESS: true = true

Defined in src/constants.ts:20


Const RETRY_DELAY

RETRY_DELAY: 100 = 100

Defined in src/constants.ts:18


Const RETRY_LIMIT

RETRY_LIMIT: number = Infinity

Defined in src/constants.ts:19


Const RX_LOCK_CHANNEL

RX_LOCK_CHANNEL: RegExp = new RegExp(^__${PgIpLock.name}__:)

Defined in src/PgIpLock.ts:344


Const SCHEMA_NAME

SCHEMA_NAME: "pgip_lock" = "pgip_lock"

Defined in src/constants.ts:16


Const SHUTDOWN_TIMEOUT

SHUTDOWN_TIMEOUT: 500 = 500

Defined in src/constants.ts:17


Let timer

timer: any

Defined in src/PgIpLock.ts:346

Functions

pack

pack(input: AnyJson, logger?: AnyLogger, pretty: boolean): string

Defined in src/helpers.ts:27

Serializes given input object to JSON string. On error will return serialized null value

Parameters:

Name Type Default Description
input AnyJson - serializable object
logger? AnyLogger - -
pretty boolean false -

Returns: string


terminate

terminate(): Promise‹void›

Defined in src/PgIpLock.ts:351

Performs graceful shutdown of running process releasing all instantiated locks and properly destroy all their instances.

Returns: Promise‹void›


unpack

unpack(input?: undefined | string, logger?: AnyLogger): AnyJson

Defined in src/helpers.ts:57

Deserializes given input JSON string to corresponding JSON value object. On error will return empty object

Parameters:

Name Type Description
input? undefined | string string to deserialize
logger? AnyLogger -

Returns: AnyJson

Object literals

Const DefaultOptions

DefaultOptions: object

Defined in src/types/PgPubSubOptions.ts:87

Hard-coded pre-set of PgPubSubOptions

see PgPubSubOptions

type {PgPubSubOptions}

acquireInterval

acquireInterval: number = ACQUIRE_INTERVAL

Defined in src/types/PgPubSubOptions.ts:91

retryDelay

retryDelay: number = RETRY_DELAY

Defined in src/types/PgPubSubOptions.ts:89

retryLimit

retryLimit: number = RETRY_LIMIT

Defined in src/types/PgPubSubOptions.ts:88

singleListener

singleListener: true = IS_ONE_PROCESS

Defined in src/types/PgPubSubOptions.ts:90

Clone this wiki locally