@nxtedition/scheduler 3.0.8 → 3.0.10
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/lib/index.d.ts +8 -8
- package/lib/index.js +10 -10
- package/package.json +4 -4
package/lib/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export type Priority = -3 | -2 | -1 | 0 | 1 | 2 | 3 | 'lowest' | 'lower' | 'low' | 'normal' | 'high' | 'higher' | 'highest';
|
|
2
|
-
export declare function parsePriority(p: string | number):
|
|
2
|
+
export declare function parsePriority(p: string | number): -3 | -2 | -1 | 0 | 1 | 2 | 3;
|
|
3
3
|
export declare class Scheduler {
|
|
4
4
|
#private;
|
|
5
|
-
static LOWEST
|
|
6
|
-
static LOWER
|
|
7
|
-
static LOW
|
|
8
|
-
static NORMAL
|
|
9
|
-
static HIGH
|
|
10
|
-
static HIGHER
|
|
11
|
-
static HIGHEST
|
|
5
|
+
static readonly LOWEST = -3;
|
|
6
|
+
static readonly LOWER = -2;
|
|
7
|
+
static readonly LOW = -1;
|
|
8
|
+
static readonly NORMAL = 0;
|
|
9
|
+
static readonly HIGH = 1;
|
|
10
|
+
static readonly HIGHER = 2;
|
|
11
|
+
static readonly HIGHEST = 3;
|
|
12
12
|
get concurrency(): number;
|
|
13
13
|
get stats(): {
|
|
14
14
|
deferred: number;
|
package/lib/index.js
CHANGED
|
@@ -25,7 +25,7 @@ class FastQueue {
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
export function parsePriority(p )
|
|
28
|
+
export function parsePriority(p ) {
|
|
29
29
|
if (typeof p === 'number') {
|
|
30
30
|
// Do nothing...
|
|
31
31
|
} else if (p === 'lowest') {
|
|
@@ -53,18 +53,18 @@ export function parsePriority(p ) {
|
|
|
53
53
|
} else if (p > 3) {
|
|
54
54
|
return 3
|
|
55
55
|
} else {
|
|
56
|
-
return Math.trunc(p)
|
|
56
|
+
return Math.trunc(p)
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
export class Scheduler {
|
|
61
|
-
static
|
|
62
|
-
static
|
|
63
|
-
static
|
|
64
|
-
static
|
|
65
|
-
static
|
|
66
|
-
static
|
|
67
|
-
static
|
|
61
|
+
static LOWEST = -3
|
|
62
|
+
static LOWER = -2
|
|
63
|
+
static LOW = -1
|
|
64
|
+
static NORMAL = 0
|
|
65
|
+
static HIGH = 1
|
|
66
|
+
static HIGHER = 2
|
|
67
|
+
static HIGHEST = 3
|
|
68
68
|
|
|
69
69
|
#concurrency
|
|
70
70
|
#stateView
|
|
@@ -122,7 +122,7 @@ export class Scheduler {
|
|
|
122
122
|
|
|
123
123
|
run (
|
|
124
124
|
fn ,
|
|
125
|
-
priority
|
|
125
|
+
priority = Scheduler.NORMAL,
|
|
126
126
|
opaque ,
|
|
127
127
|
) {
|
|
128
128
|
return new Promise ((resolve, reject) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nxtedition/scheduler",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/node": "^25.2.3",
|
|
26
26
|
"amaroc": "^1.0.1",
|
|
27
|
-
"oxlint-tsgolint": "^0.
|
|
28
|
-
"rimraf": "^6.1.
|
|
27
|
+
"oxlint-tsgolint": "^0.13.0",
|
|
28
|
+
"rimraf": "^6.1.3",
|
|
29
29
|
"typescript": "^5.9.3"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "b58c17cb0fdb8c6781ea35addb2c3b4348dba0d6"
|
|
32
32
|
}
|