nanium-queue-mongodb
v1.0.2
Published
request queue for the nanium framework using a mongodb collection to hold the request entries
Downloads
9
Readme
nanium-queue-mongodb
A nanium request queue using a mongodb collection to manage the request entries.
Install
npm install nanium-queue-mongodb
Usage
Usage
import { Nanium } from 'nanium/core';
import { NaniumMongoQueue } from 'nanium-queue-mongodb';
import * as express from 'express';
mongoQueue = new NaniumMongoQueue({
checkInterval: 10,
serverUrl: 'mongodb://localhost:27017',
databaseName: 'test',
collectionName: 'requestQueue',
});
await Nanium.addQueue(mongoQueue);
Connects to the mongodb server specified through the serverUrl. Creates a collection with the name specivied by collectionName in the database databaseName. Every checkInterval seconds it checks vor new request entries or changed states. It executes requests that are ready and writes the result back to the entry in the collection.