Background job queue orchestration (memory / redis drivers).
Engine-internal — apps use require('queue').
- Description:
- Background job queue orchestration (memory / redis drivers).
Engine-internal — apps use require('queue').
Members
(static) _processOne
- Description:
- test helper: process without delay
test helper: process without delay
(inner, constant) activeJobs :Map.<string, object>
Type:
(inner) appsRegistry :object|null
Type:
(inner) delayedCount
- Description:
- Driver-level delayed count
Driver-level delayed count
(inner) driver :object|null
Type:
(inner) globalConfigRef :object|null
Type:
(inner) pendingCount
- Description:
- Driver-level ready pool size (redis: shared; memory: includes not-yet-claimed)
Driver-level ready pool size (redis: shared; memory: includes not-yet-claimed)
(inner) serverConfig :object
Type:
(inner) serverLogger :object|null
Type:
(inner, constant) waitQueue :Array.<object>
Type:
Methods
(async, inner) addJob(app, name, payload, optionsopt)
- Description:
- Enqueue a job for an app (engine entry; permission checked by public module).
Parameters:
| Name |
Type |
Attributes |
Description |
app |
object
|
|
|
name |
string
|
|
|
payload |
*
|
|
|
options |
object
|
<optional>
|
|
(async, inner) discardDlqJob(jobId) → {Promise.<boolean>}
- Description:
- Remove a job from the DLQ without re-running.
Parameters:
| Name |
Type |
Description |
jobId |
string
|
|
Returns:
-
Type
-
Promise.<boolean>
(async, inner) failOrRetry(job, err)
Parameters:
| Name |
Type |
Description |
job |
object
|
|
err |
Error
|
|
(async, inner) getAdminStats() → {Promise.<object>}
Returns:
-
Type
-
Promise.<object>
(async, inner) getDlqJob(jobId) → {Promise.<(object|null)>}
Parameters:
| Name |
Type |
Description |
jobId |
string
|
|
Returns:
-
Type
-
Promise.<(object|null)>
(async, inner) initServer(cfg, logger, globalConfig)
Parameters:
| Name |
Type |
Description |
cfg |
object
|
null
|
undefined
|
|
logger |
object
|
|
globalConfig |
object
|
|
(async, inner) listDlq(optsopt) → {Promise.<Array.<object>>}
Parameters:
| Name |
Type |
Attributes |
Description |
opts |
object
|
<optional>
|
Properties
| Name |
Type |
Attributes |
Description |
appName |
string
|
<optional>
|
|
limit |
number
|
<optional>
|
|
|
Returns:
-
Type
-
Promise.<Array.<object>>
(async, inner) listLiveJobs(optsopt) → {Promise.<Array.<object>>}
- Description:
- Live jobs: running/waiting on this node + pending/delayed in the driver.
Parameters:
| Name |
Type |
Attributes |
Description |
opts |
object
|
<optional>
|
Properties
| Name |
Type |
Attributes |
Description |
appName |
string
|
<optional>
|
|
limit |
number
|
<optional>
|
|
|
Returns:
-
Type
-
Promise.<Array.<object>>
(async, inner) moveToDlq(job, err)
Parameters:
| Name |
Type |
Description |
job |
object
|
|
err |
Error
|
string
|
|
(async, inner) processOne(job)
Parameters:
| Name |
Type |
Description |
job |
object
|
|
(inner) resolveJobScript(app, jobName, scriptOverrideopt)
- Description:
- Resolve relative job script under app box.
Parameters:
| Name |
Type |
Attributes |
Description |
app |
object
|
|
|
jobName |
string
|
|
|
scriptOverride |
string
|
<optional>
|
|
(async, inner) retryDlqJob(jobId) → {Promise.<object>}
- Description:
- Re-enqueue a dead-lettered job (attempt reset to 1).
Parameters:
| Name |
Type |
Description |
jobId |
string
|
|
Returns:
-
Type
-
Promise.<object>
(inner) setAppsRegistry(apps)
Parameters:
| Name |
Type |
Description |
apps |
object
|
null
|
|