Queue job. Light, fast and secure.
npm install @cimo/queueNpm package, queue job. Light, fast and secure.
Writed with native Typescript code and no dependencies are used.
1. npm run build
2. Copy the file "/build/package_name-x.x.x.tgz" in the project root folder.
3. In the "package.json" file insert: "@cimo/package_name": "file:package_name-x.x.x.tgz"
1. npm run build
2. npm login --auth-type=legacy
3. npm publish --auth-type=legacy --access public
1. Link for npm package -> https://www.npmjs.com/package/@cimo/queue
- Server.ts
``
...
import { Cu } from "@cimo/queue/dist/src/Main";
...
post("/api/v1/test1", () => {
cu.list.push(() => {
return new Promise((resolve) => {
...
resolve();
return;
});
});
cu.processSerial();
});
post("/api/v1/test2", () => {
cu.list.push(() => {
return new Promise((resolve) => {
...
resolve();
return;
});
});
cu.processParallel(2);
});
...
``