vanilla-queues-js
Advanced tools
Comparing version 1.0.5 to 1.0.6
{ | ||
"name": "vanilla-queues-js", | ||
"version": "1.0.5", | ||
"description": "create jobs in queues this can be handle in node, typescript, angular, react, vue, and all js based framework", | ||
"version": "1.0.6", | ||
"description": "create jobs in queues/threads this can be handle in node, typescript, angular, react, vue, and all js based framework", | ||
"main": "index.js", | ||
@@ -18,2 +18,5 @@ "scripts": { | ||
"queues", | ||
"multi threads", | ||
"threads", | ||
"async threads", | ||
"vanilla js queues", | ||
@@ -23,3 +26,7 @@ "angular queues", | ||
"nodejs queues", | ||
"typescript queues" | ||
"typescript queues", | ||
"angular threads", | ||
"react threads", | ||
"nodejs threads", | ||
"typescript threads" | ||
], | ||
@@ -29,5 +36,6 @@ "author": "Shantanu Sharma", | ||
"bugs": { | ||
"url": "https://github.com/umbrashia/vanilla-queues-js/issues" | ||
"url": "https://github.com/umbrashia/vanilla-queues-js/issues", | ||
"email":"shantanu34@outlook.com" | ||
}, | ||
"homepage": "https://github.com/umbrashia/vanilla-queues-js#readme" | ||
"homepage": "https://umbrashia.github.io/vanilla-queues-js/" | ||
} |
# vanilla-queues-js | ||
create and manage queues in core javascript or Vanilla JS it can be use any javascript framework like ReactJs, Angular React-Native and VueJs | ||
create and manage queues threads in core javascript or Vanilla JS it can be use any javascript framework like ReactJs, Angular React-Native and VueJs | ||
@@ -10,30 +10,20 @@ | ||
``` | ||
import * as vanillaQueuesJs from "vanilla-queues-js"; | ||
// creating object | ||
let vanilaQue = new vanillaQueuesJs.VanillaQueues<number>(5); | ||
//set your jobs | ||
for (let index = 0; index < 100; index++) { | ||
//Add into stack | ||
vanilaQue.addJob((data, counter) => { | ||
//AJAX CAMOUFLAGE (WAIT FOR RANDOM 1 to 3 SEC) | ||
setTimeout(() => { | ||
console.log(data, "------> executed ---->", counter); | ||
//------ | ||
vanilaQue.jobDone();//MARK AS SINGLE JOB IS DONE AFTER CALL "jobDone()" next job is start | ||
//----- | ||
}, Math.floor(Math.random() * 3000) + 1000); | ||
}, index); | ||
} | ||
@@ -54,8 +44,11 @@ | ||
<script> | ||
let vanilaQue = new VanillaQueues<number>(5); | ||
// creating object | ||
var vanilaQue = new VanillaQueues<number>(5); | ||
for (let index = 0; index < 100; index++) { | ||
vanilaQue.addJob((data, counter) => { | ||
console.log(counter,"****"); | ||
setTimeout(() => { | ||
//set your jobs | ||
for (var index = 0; index < 100; index++) { | ||
//Add into stack | ||
vanilaQue.addJob(function(data, counter){ | ||
//AJAX CAMOUFLAGE (WAIT FOR RANDOM 1 to 3 SEC) | ||
setTimeout(function(){ | ||
console.log(data, "------> executed ---->", counter); | ||
@@ -67,3 +60,3 @@ vanilaQue.jobDone(); | ||
vanilaQue.isDone(() => { | ||
vanilaQue.isDone(function() { | ||
console.log("oeeeeee done..."); | ||
@@ -70,0 +63,0 @@ |
Sorry, the diff of this file is not supported yet
50135
64