A nanium request queue using a mongodb collection to manage the request entries.
npm install nanium-queue-mongodb
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.