async-queue-runner 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/_cjs/package.json CHANGED
@@ -1,4 +1,4 @@
1
- {
2
- "type": "commonjs"
3
- }
4
-
1
+ {
2
+ "type": "commonjs"
3
+ }
4
+
package/_cjs/queue.js CHANGED
@@ -8,15 +8,15 @@ class AsyncQueue {
8
8
  end;
9
9
  loopAction = false;
10
10
  context = {
11
- push: this.push,
11
+ push: (actions) => this.push(actions),
12
12
  stop: () => { this.loopAction = false; },
13
13
  extend: (obj) => Object.assign(this.context, obj),
14
+ name: this.name,
14
15
  };
15
16
  constructor(opts) {
16
17
  this.queue = opts.actions;
17
18
  this.name = opts.name;
18
19
  this.end = opts.end;
19
- this.push = this.push.bind(this);
20
20
  }
21
21
  async delay(timeout) {
22
22
  return new Promise((res) => setTimeout(res, timeout));
@@ -38,7 +38,7 @@ class AsyncQueue {
38
38
  this.end();
39
39
  }
40
40
  catch (e) {
41
- console.log(`Queue(${this.name} failed`);
41
+ console.log(`Queue(${this.name}) failed`);
42
42
  console.error(e);
43
43
  }
44
44
  }
package/_esm/package.json CHANGED
@@ -1,4 +1,4 @@
1
- {
2
- "type": "module"
3
- }
4
-
1
+ {
2
+ "type": "module"
3
+ }
4
+
package/_esm/queue.js CHANGED
@@ -5,15 +5,15 @@ export class AsyncQueue {
5
5
  end;
6
6
  loopAction = false;
7
7
  context = {
8
- push: this.push,
8
+ push: (actions) => this.push(actions),
9
9
  stop: () => { this.loopAction = false; },
10
10
  extend: (obj) => Object.assign(this.context, obj),
11
+ name: this.name,
11
12
  };
12
13
  constructor(opts) {
13
14
  this.queue = opts.actions;
14
15
  this.name = opts.name;
15
16
  this.end = opts.end;
16
- this.push = this.push.bind(this);
17
17
  }
18
18
  async delay(timeout) {
19
19
  return new Promise((res) => setTimeout(res, timeout));
@@ -35,7 +35,7 @@ export class AsyncQueue {
35
35
  this.end();
36
36
  }
37
37
  catch (e) {
38
- console.log(`Queue(${this.name} failed`);
38
+ console.log(`Queue(${this.name}) failed`);
39
39
  console.error(e);
40
40
  }
41
41
  }
package/_types/types.d.ts CHANGED
@@ -12,4 +12,5 @@ export type QueueContext = {
12
12
  push: (actions: QueueAction[]) => void;
13
13
  extend: (obj: Partial<object>) => void;
14
14
  stop: () => void;
15
+ name: string;
15
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "async-queue-runner",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Library to run in parallel extendable queue of tasks",
5
5
  "type": "module",
6
6
  "scripts": {