Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 10
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
• ConstACQUIRE_INTERVAL: 30000 = 30000
• ConstDefaultOptions: 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
• ConstIS_ONE_PROCESS: true = true
• ConstRETRY_DELAY: 100 = 100
• ConstRETRY_LIMIT: number = Infinity
• ConstRX_LOCK_CHANNEL: RegExp = new RegExp(`^(__${PgIpLock.name}__:)+`)
• ConstSCHEMA_NAME: string = process.env.PG_PUBSUB_SCHEMA_NAME || 'pgip_lock'
• ConstSHUTDOWN_TIMEOUT: number = +( process.env.PG_PUBSUB_SHUTDOWN_TIMEOUT || 1000)
• Timeout: any
• Lettimer: 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