-
Notifications
You must be signed in to change notification settings - Fork 9
Home
Globals
- ACQUIRE_INTERVAL
- DefaultOptions
- IS_ONE_PROCESS
- RETRY_DELAY
- RETRY_LIMIT
- RX_LOCK_CHANNEL
- SCHEMA_NAME
- SHUTDOWN_TIMEOUT
- Timeout
- timer
Ƭ AnyJson: boolean | number | string | null | JsonArray | JsonMap
Represents any JSON-serializable value
Ƭ JsonArray: AnyJson[]
Represents JSON-serializable array
• Const
ACQUIRE_INTERVAL: 30000 = 30000
• Const
DefaultOptions: PgPubSubOptions = Object.freeze({ retryLimit: RETRY_LIMIT, retryDelay: RETRY_DELAY, singleListener: IS_ONE_PROCESS, acquireInterval: ACQUIRE_INTERVAL, filtered: false,})
Hard-coded pre-set of PgPubSubOptions
see
PgPubSubOptions
• Const
IS_ONE_PROCESS: true = true
• Const
RETRY_DELAY: 100 = 100
• Const
RETRY_LIMIT: number = Infinity
• Const
RX_LOCK_CHANNEL: RegExp = new RegExp(`^__${PgIpLock.name}__:`)
• Const
SCHEMA_NAME: string = process.env.PG_PUBSUB_SCHEMA_NAME || 'pgip_lock'
• Const
SHUTDOWN_TIMEOUT: number = +( process.env.PG_PUBSUB_SHUTDOWN_TIMEOUT || 1000)
• Timeout: any
• Let
timer: any
▸ pack(input
: AnyJson, logger?
: AnyLogger, pretty?
: boolean): string
Serializes given input object to JSON string. On error will return serialized null value
Name | Type | Default value | Description |
---|---|---|---|
input |
AnyJson | - | serializable value |
logger? |
AnyLogger | - | - |
pretty |
boolean | false | - |
Returns: string
▸ stringify(input
: AnyJson, pretty?
: undefined | false | true): string
Performs JSON.stringify on a given input taking into account pretty flag.
access
private
Name | Type | Description |
---|---|---|
input |
AnyJson | serializable value |
pretty? |
undefined | false | true | - |
Returns: string
▸ terminate(): Promise<void>
Performs graceful shutdown of running process releasing all instantiated locks and properly destroy all their instances.
Returns: Promise<void>
▸ unpack(input?
: undefined | string, logger?
: AnyLogger): AnyJson
Deserializes given input JSON string to corresponding JSON value object. On error will return empty object
Name | Type | Description |
---|---|---|
input? |
undefined | string | string to deserialize |
logger? |
AnyLogger | - |
Returns: AnyJson