-
Notifications
You must be signed in to change notification settings - Fork 9
Home
- 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
• ACQUIRE_INTERVAL: 30000 = 30000
• 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
• IS_ONE_PROCESS: true = true
• RETRY_DELAY: 100 = 100
• RETRY_LIMIT: number = Infinity
• RX_LOCK_CHANNEL: RegExp‹› = new RegExp(^__${PgIpLock.name}__:
)
• SCHEMA_NAME: "pgip_lock" = "pgip_lock"
• SHUTDOWN_TIMEOUT: 500 = 500
• Timeout: any
• timer: any
▸ pack(input
: AnyJson, logger?
: AnyLogger, pretty
: boolean): string
Serializes given input object to JSON string. On error will return serialized null value
Parameters:
Name | Type | Default | 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
Parameters:
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
Parameters:
Name | Type | Description |
---|---|---|
input? |
undefined | string | string to deserialize |
logger? |
AnyLogger | - |
Returns: AnyJson