Skip to main content

SQLiteQueueParameters

@webda/sqlite


Class: SQLiteQueueParameters

Defined in: sqlite/src/sqlitequeue.service.ts:11

Configuration for SQLiteQueueService

Extends​

  • QueueParameters

Implements​

Constructors​

Constructor​

new SQLiteQueueParameters(): SQLiteQueueParameters

Returns​

SQLiteQueueParameters

Inherited from​

QueueParameters.constructor

Properties​

autoCreateTable?​

optional autoCreateTable?: boolean

Defined in: sqlite/src/sqlitequeue.service.ts:32

Create the queue table on init

Default​

true

batchSize?​

optional batchSize?: number

Defined in: sqlite/src/sqlitequeue.service.ts:27

Messages per receiveMessage

Default​

10

busyTimeout?​

optional busyTimeout?: number

Defined in: sqlite/src/sqlitequeue.service.ts:51

PRAGMA busy_timeout in ms

Default​

5000

Implementation of​

SQLiteConnectionParameters.busyTimeout


database?​

optional database?: SQLDatabase

Defined in: sqlite/src/sqlitequeue.service.ts:46

Services giving the same database name share one handle

Implementation of​

SQLiteConnectionParameters.database


idleDelayer?​

optional idleDelayer?: WaitDelayerDefinition

Defined in: core/lib/queues/queueservice.d.ts:47

Delayer between two receives of the main consumer while the queue returns no message

Queues answering immediately when empty (PostgresQueue, AMQPQueue...) would otherwise be polled in a tight loop. The delay grows with the consecutive empty receives, up to maxIdleDelay; the time spent in the receive is deducted, so long-polling queues (SQSQueue, FileQueue, MemoryQueue with a timeout) are not slowed down.

Default​

{ "type": "exponential", "interval": 50 }

Inherited from​

QueueParameters.idleDelayer


maxConsumers​

maxConsumers: number

Defined in: core/lib/queues/queueservice.d.ts:37

Max number of queue consumers Queue will auto increase to this max number if queue is loaded and it will decrease to just one consumer if no messages are available

Default​

10

Inherited from​

QueueParameters.maxConsumers


maxIdleDelay?​

optional maxIdleDelay?: number

Defined in: core/lib/queues/queueservice.d.ts:56

Maximum delay between two receives while the queue stays empty, in milliseconds

It bounds the extra latency of the first message after an idle period, and the polling rate of an idle consumer (4 receives per second at 250ms).

Default​

250

Inherited from​

QueueParameters.maxIdleDelay


persistence?​

optional persistence?: SQLitePersistence

Defined in: sqlite/src/sqlitequeue.service.ts:42

Omitted: in-memory queue, lost on stop(); set: file database, messages survive restarts

Implementation of​

SQLiteConnectionParameters.persistence


pragmas?​

optional pragmas?: Record<string, string | number>

Defined in: sqlite/src/sqlitequeue.service.ts:55

Extra PRAGMAs run on open

Implementation of​

SQLiteConnectionParameters.pragmas


table?​

optional table?: string

Defined in: sqlite/src/sqlitequeue.service.ts:17

Table backing the queue, created on init

Default​

"webda_queue"

Pattern​

/^[a-zA-Z_][a-zA-Z0-9_]*$/


type​

type: string

Defined in: core/lib/services/serviceparameters.d.ts:9

Type of the service

Inherited from​

QueueParameters.type


visibilityTimeout?​

optional visibilityTimeout?: number

Defined in: sqlite/src/sqlitequeue.service.ts:22

Seconds a received but not deleted message stays invisible before being delivered again

Default​

30

waitTime?​

optional waitTime?: number

Defined in: sqlite/src/sqlitequeue.service.ts:38

Seconds an empty receiveMessage waits for a message before returning (long polling): a message sent by this process ends the wait at once, one written by another process is seen at the end of it

Default​

1

workerDelayer?​

optional workerDelayer?: WaitDelayerDefinition

Defined in: core/lib/queues/queueservice.d.ts:24

Delayer between two failed attempts to process messages

Inherited from​

QueueParameters.workerDelayer


workerParallelism​

workerParallelism: boolean

Defined in: core/lib/queues/queueservice.d.ts:29

Define if worker should process multi message received in //

Default​

true

Inherited from​

QueueParameters.workerParallelism

Methods​

load()​

load(params?): this

Defined in: sqlite/src/sqlitequeue.service.ts:62

Parameters​

params?​

any = {}

the input parameters

Returns​

this

this

Overrides​

QueueParameters.load


update()​

update(params, delta): this

Defined in: core/lib/application/parameters.d.ts:21

Update parameters and call watchers if a parameter was changed

Parameters​

params​

any

the service parameters

delta​

any

the delta

Returns​

this

this for chaining

Inherited from​

QueueParameters.update


with()​

with(callback): this

Defined in: core/lib/application/parameters.d.ts:27

Watch for changes on the parameters and call watchers when a parameter is changed

Parameters​

callback​

(params) => void

the callback function

Returns​

this

this for chaining

Inherited from​

QueueParameters.with