A persistent Job Queue for your Space implementation. Uses the well maintained and tested vsivsi:job-collection - A persistent and reactive job queue for Meteor, supporting distributed workers that can run anywhere.
Licensed under the MIT license | Changelog | 1.0 Milestone list
Documentation in this package only relates to the Space implementation. See job-collection documentation for an overview of the underlying infrastructure.
See space:job-queue-ui non-view UI elements.
A single job-collection instance is configured and mapped to the injector
as 'Space.jobQueue.Jobs'
configuration: Space.getenv.multi({
jobQueue: {
log: {
enabled: ['SPACE_JQ_LOG_ENABLED', false, 'bool'],
mode: ['SPACE_JQ_LOG_MODE', 'normal', 'string']
},
promoteInterval: ['SPACE_JQ_PROMOTE_INTERVAL', 15000, 'int'],
serverInstanceQty: ['SPACE_JQ_SERVER_INSTANCE_QTY', 1, 'int'],
remoteAccess: {
enabled: ['SPACE_JQ_REMOTE_ACCESS_ENABLED', true, 'bool'],
publish: ['SPACE_JQ_REMOTE_ACCESS_PUBLISH', true, 'bool']
},
stats: {
jobServer: {
publish: ['SPACE_JQ_STATS_JOB_SERVER_PUBLISH', false, 'bool']
},
connectedWorkers: {
publish: ['SPACE_JQ_STATS_CONNECTED_WORKERS_PUBLISH', false, 'bool']
}
}
}
})
In addition to the Module.configuration API above are these ENV-only options:
SPACE_JQ_COLLECTION_NAME
- defaults tospace_jobQueue_jobs
SPACE_JQ_MONGO_URL
SPACE_JQ_MONGO_OPLOG_URL
Documentation coming soon, but there is full support now and enabled by default
Job server events are translated and published on the server-side Space.messaging.EventBus module instance ready for deep integration with your Space implementation.
space-jobQueue-ready-jobs
- Use for observer-based remote workers- enabled using
remoteAccess.publish
configuration. - Optionally pass a
lastSessionId
property to reliably track connected workers. - In your remote worker the subscription's connectionId can be saved to disk and passed back on reconnection to handle a few different disconnection/exit scenarios. This will be better documented when there's an example to reference.
space-jobQueue-job-server-stats
- Exposes the jobServer running state and promoteInterval.- Useful for visualising the state in your UI, such as a green or red solid circle.
space-jobQueue-connected-workers
- Exposes a collection of connected worker connections across all instances.- Useful for showing a count in your UI
normal
default, simple messagefull
contains the message and full event payload
meteor add space:job-queue
Add 'Space.jobQueue'
to the requiredModules
array on a server module or application.
meteor test-packages ./