Compare commits

..

8 Commits

Author SHA1 Message Date
8f9b3151d8 2.1.13 2020-09-07 23:52:23 +00:00
81e97b513a fix(core): update 2020-09-07 23:52:22 +00:00
7da0035805 2.1.12 2020-09-07 17:35:51 +00:00
16a77e4c41 fix(core): update 2020-09-07 17:35:50 +00:00
495f63ec71 2.1.11 2020-09-04 16:09:44 +00:00
17f840d24c fix(core): update 2020-09-04 16:09:44 +00:00
b93407e83a 2.1.10 2020-09-04 06:47:31 +00:00
003c1f2796 fix(core): update 2020-09-04 06:47:30 +00:00
3 changed files with 16 additions and 19 deletions

20
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/taskbuffer",
"version": "2.1.9",
"version": "2.1.13",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -1589,9 +1589,9 @@
}
},
"@pushrocks/smartlog": {
"version": "2.0.36",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartlog/-/smartlog-2.0.36.tgz",
"integrity": "sha512-guM03567UFZebx3urBQdiQecZwKvrR8c8fzt7EDPrI1ihArZc7ab6MQEu9yklPKqJMGLEz8t0oExgQ8804r73g==",
"version": "2.0.37",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartlog/-/smartlog-2.0.37.tgz",
"integrity": "sha512-EfF/Zp8tpRdJwZtwFMeQdurd4wEvT2S/kx9iRf362aER93wyO8NUuGyyN6U52hgEN5r1VDgG27lpNXc+ZKwRMw==",
"requires": {
"@pushrocks/isounique": "^1.0.4",
"@pushrocks/smartlog-interfaces": "^2.0.20"
@ -1973,9 +1973,9 @@
}
},
"@pushrocks/smarttime": {
"version": "3.0.28",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmarttime/-/smarttime-3.0.28.tgz",
"integrity": "sha512-ygAz6/0a1XVH7cLwQlVcs2soMF84tMq7lBWBsguJK2zNbP3SUBVudyyDp4OeIDUGb6lswcsmc0YeoI6g3vGU4Q==",
"version": "3.0.35",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmarttime/-/smarttime-3.0.35.tgz",
"integrity": "sha512-KBDprr2gMcw+21kD6GkJ0Y9fc/SuMijhFPDKoBmuCW9Nhn+KAnabCB8Qn8OzeUuQcoHQ3SFJ/4KioJWNxMgxaQ==",
"requires": {
"@pushrocks/lik": "^4.0.17",
"@pushrocks/smartdelay": "^2.0.10",
@ -2297,9 +2297,9 @@
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA=="
},
"@types/node": {
"version": "14.6.3",
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-14.6.3.tgz",
"integrity": "sha512-pC/hkcREG6YfDfui1FBmj8e20jFU5Exjw4NYDm8kEdrW+mOh0T1Zve8DWKnS7ZIZvgncrctcNCXF4Q2I+loyww=="
"version": "14.6.4",
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-14.6.4.tgz",
"integrity": "sha512-Wk7nG1JSaMfMpoMJDKUsWYugliB2Vy55pdjLpmLixeyMi7HizW2I/9QoxsPCkXl3dO+ZOVqPumKaDUv5zJu2uQ=="
},
"@types/parcel-bundler": {
"version": "1.12.1",

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/taskbuffer",
"version": "2.1.9",
"version": "2.1.13",
"private": false,
"description": "flexible task management. TypeScript ready!",
"main": "dist_ts/index.js",
@ -29,10 +29,10 @@
"dependencies": {
"@pushrocks/lik": "^4.0.17",
"@pushrocks/smartdelay": "^2.0.10",
"@pushrocks/smartlog": "^2.0.36",
"@pushrocks/smartlog": "^2.0.37",
"@pushrocks/smartpromise": "^3.0.6",
"@pushrocks/smartrx": "^2.0.18",
"@pushrocks/smarttime": "^3.0.28",
"@pushrocks/smarttime": "^3.0.35",
"@types/cron": "^1.7.2"
},
"devDependencies": {
@ -40,7 +40,7 @@
"@gitzone/tsbundle": "^1.0.78",
"@gitzone/tstest": "^1.0.44",
"@pushrocks/tapbundle": "^3.2.9",
"@types/node": "^14.6.3",
"@types/node": "^14.6.4",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0"
},

View File

@ -4,7 +4,6 @@ export class BufferRunner {
public task: Task;
// initialze by default
public bufferCounter: number = 0;
public running: boolean = false;
constructor(taskArg: Task) {
this.task = taskArg;
}
@ -16,7 +15,7 @@ export class BufferRunner {
const returnPromise: Promise<any> = this.task.cycleCounter.getPromiseForCycle(
this.bufferCounter + 1
);
if (!this.running) {
if (!this.task.running) {
this._run(x);
}
return returnPromise;
@ -25,15 +24,13 @@ export class BufferRunner {
private _run(x) {
const recursiveBufferRunner = (x) => {
if (this.bufferCounter >= 0) {
this.running = true;
this.task.running = true;
Task.runTask(this.task, { x: x }).then((x) => {
this.bufferCounter--;
this.bufferCounter--; // this.bufferCounter drops below 0, the recursion stops.
this.task.cycleCounter.informOfCycle(x);
recursiveBufferRunner(x);
});
} else {
this.running = false;
this.task.running = false;
}
};