@h3ravel/queue 11.1.0-alpha.9 → 11.15.0-alpha.12
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/dist/index.cjs +15 -19
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -10
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
let
|
|
3
|
-
let
|
|
4
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let _h3ravel_support = require("@h3ravel/support");
|
|
3
|
+
let _h3ravel_contracts = require("@h3ravel/contracts");
|
|
4
|
+
let _h3ravel_core = require("@h3ravel/core");
|
|
5
5
|
//#region src/Events/JobFailed.ts
|
|
6
6
|
var JobFailed = class {
|
|
7
|
+
connectionName;
|
|
8
|
+
job;
|
|
9
|
+
exception;
|
|
7
10
|
/**
|
|
8
11
|
* Create a new event instance.
|
|
9
12
|
*
|
|
@@ -17,14 +20,12 @@ var JobFailed = class {
|
|
|
17
20
|
this.exception = exception;
|
|
18
21
|
}
|
|
19
22
|
};
|
|
20
|
-
|
|
21
23
|
//#endregion
|
|
22
24
|
//#region src/Exceptions/ManuallyFailedException.ts
|
|
23
|
-
var ManuallyFailedException = class extends
|
|
24
|
-
|
|
25
|
+
var ManuallyFailedException = class extends _h3ravel_support.RuntimeException {};
|
|
25
26
|
//#endregion
|
|
26
27
|
//#region src/Exceptions/MaxAttemptsExceededException.ts
|
|
27
|
-
var MaxAttemptsExceededException = class MaxAttemptsExceededException extends
|
|
28
|
+
var MaxAttemptsExceededException = class MaxAttemptsExceededException extends _h3ravel_support.RuntimeException {
|
|
28
29
|
/**
|
|
29
30
|
* The job instance.
|
|
30
31
|
*/
|
|
@@ -35,12 +36,11 @@ var MaxAttemptsExceededException = class MaxAttemptsExceededException extends __
|
|
|
35
36
|
* @param job
|
|
36
37
|
*/
|
|
37
38
|
static forJob(job) {
|
|
38
|
-
return (0,
|
|
39
|
+
return (0, _h3ravel_support.tap)(new MaxAttemptsExceededException(job.resolveName() + " has been attempted too many times."), (e) => {
|
|
39
40
|
e.job = job;
|
|
40
41
|
});
|
|
41
42
|
}
|
|
42
43
|
};
|
|
43
|
-
|
|
44
44
|
//#endregion
|
|
45
45
|
//#region src/Exceptions/TimeoutExceededException.ts
|
|
46
46
|
var TimeoutExceededException = class TimeoutExceededException extends MaxAttemptsExceededException {
|
|
@@ -50,12 +50,11 @@ var TimeoutExceededException = class TimeoutExceededException extends MaxAttempt
|
|
|
50
50
|
* @param job
|
|
51
51
|
*/
|
|
52
52
|
static forJob(job) {
|
|
53
|
-
return (0,
|
|
53
|
+
return (0, _h3ravel_support.tap)(new TimeoutExceededException(job.resolveName() + " has timed out."), (e) => {
|
|
54
54
|
e.job = job;
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
|
-
|
|
59
58
|
//#endregion
|
|
60
59
|
//#region src/Jobs/JobName.ts
|
|
61
60
|
var JobName = class {
|
|
@@ -88,7 +87,6 @@ var JobName = class {
|
|
|
88
87
|
return name;
|
|
89
88
|
}
|
|
90
89
|
};
|
|
91
|
-
|
|
92
90
|
//#endregion
|
|
93
91
|
//#region src/Jobs/Job.ts
|
|
94
92
|
var Job = class {
|
|
@@ -155,7 +153,7 @@ var Job = class {
|
|
|
155
153
|
*
|
|
156
154
|
* @param delay
|
|
157
155
|
*/
|
|
158
|
-
release(
|
|
156
|
+
release(_delay = 0) {
|
|
159
157
|
this.released = true;
|
|
160
158
|
}
|
|
161
159
|
/**
|
|
@@ -197,7 +195,7 @@ var Job = class {
|
|
|
197
195
|
this.delete();
|
|
198
196
|
this.failedJob(e);
|
|
199
197
|
} finally {
|
|
200
|
-
this.resolve(
|
|
198
|
+
this.resolve(_h3ravel_contracts.IDispatcher).dispatch(new JobFailed(this.connectionName, this, e || new ManuallyFailedException()));
|
|
201
199
|
}
|
|
202
200
|
}
|
|
203
201
|
/**
|
|
@@ -332,7 +330,6 @@ var Job = class {
|
|
|
332
330
|
return this.container;
|
|
333
331
|
}
|
|
334
332
|
};
|
|
335
|
-
|
|
336
333
|
//#endregion
|
|
337
334
|
//#region src/Providers/QueueServiceProvider.ts
|
|
338
335
|
/**
|
|
@@ -344,11 +341,10 @@ var Job = class {
|
|
|
344
341
|
*
|
|
345
342
|
* Auto-Registered if @h3ravel/queue is installed
|
|
346
343
|
*/
|
|
347
|
-
var QueueServiceProvider = class extends
|
|
344
|
+
var QueueServiceProvider = class extends _h3ravel_core.ServiceProvider {
|
|
348
345
|
static priority = 991;
|
|
349
346
|
register() {}
|
|
350
347
|
};
|
|
351
|
-
|
|
352
348
|
//#endregion
|
|
353
349
|
exports.Job = Job;
|
|
354
350
|
exports.JobFailed = JobFailed;
|
|
@@ -356,4 +352,4 @@ exports.JobName = JobName;
|
|
|
356
352
|
exports.ManuallyFailedException = ManuallyFailedException;
|
|
357
353
|
exports.MaxAttemptsExceededException = MaxAttemptsExceededException;
|
|
358
354
|
exports.QueueServiceProvider = QueueServiceProvider;
|
|
359
|
-
exports.TimeoutExceededException = TimeoutExceededException;
|
|
355
|
+
exports.TimeoutExceededException = TimeoutExceededException;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { RuntimeException, tap } from "@h3ravel/support";
|
|
2
2
|
import { IDispatcher } from "@h3ravel/contracts";
|
|
3
3
|
import { ServiceProvider } from "@h3ravel/core";
|
|
4
|
-
|
|
5
4
|
//#region src/Events/JobFailed.ts
|
|
6
5
|
var JobFailed = class {
|
|
6
|
+
connectionName;
|
|
7
|
+
job;
|
|
8
|
+
exception;
|
|
7
9
|
/**
|
|
8
10
|
* Create a new event instance.
|
|
9
11
|
*
|
|
@@ -17,11 +19,9 @@ var JobFailed = class {
|
|
|
17
19
|
this.exception = exception;
|
|
18
20
|
}
|
|
19
21
|
};
|
|
20
|
-
|
|
21
22
|
//#endregion
|
|
22
23
|
//#region src/Exceptions/ManuallyFailedException.ts
|
|
23
24
|
var ManuallyFailedException = class extends RuntimeException {};
|
|
24
|
-
|
|
25
25
|
//#endregion
|
|
26
26
|
//#region src/Exceptions/MaxAttemptsExceededException.ts
|
|
27
27
|
var MaxAttemptsExceededException = class MaxAttemptsExceededException extends RuntimeException {
|
|
@@ -40,7 +40,6 @@ var MaxAttemptsExceededException = class MaxAttemptsExceededException extends Ru
|
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
-
|
|
44
43
|
//#endregion
|
|
45
44
|
//#region src/Exceptions/TimeoutExceededException.ts
|
|
46
45
|
var TimeoutExceededException = class TimeoutExceededException extends MaxAttemptsExceededException {
|
|
@@ -55,7 +54,6 @@ var TimeoutExceededException = class TimeoutExceededException extends MaxAttempt
|
|
|
55
54
|
});
|
|
56
55
|
}
|
|
57
56
|
};
|
|
58
|
-
|
|
59
57
|
//#endregion
|
|
60
58
|
//#region src/Jobs/JobName.ts
|
|
61
59
|
var JobName = class {
|
|
@@ -88,7 +86,6 @@ var JobName = class {
|
|
|
88
86
|
return name;
|
|
89
87
|
}
|
|
90
88
|
};
|
|
91
|
-
|
|
92
89
|
//#endregion
|
|
93
90
|
//#region src/Jobs/Job.ts
|
|
94
91
|
var Job = class {
|
|
@@ -155,7 +152,7 @@ var Job = class {
|
|
|
155
152
|
*
|
|
156
153
|
* @param delay
|
|
157
154
|
*/
|
|
158
|
-
release(
|
|
155
|
+
release(_delay = 0) {
|
|
159
156
|
this.released = true;
|
|
160
157
|
}
|
|
161
158
|
/**
|
|
@@ -332,7 +329,6 @@ var Job = class {
|
|
|
332
329
|
return this.container;
|
|
333
330
|
}
|
|
334
331
|
};
|
|
335
|
-
|
|
336
332
|
//#endregion
|
|
337
333
|
//#region src/Providers/QueueServiceProvider.ts
|
|
338
334
|
/**
|
|
@@ -348,6 +344,5 @@ var QueueServiceProvider = class extends ServiceProvider {
|
|
|
348
344
|
static priority = 991;
|
|
349
345
|
register() {}
|
|
350
346
|
};
|
|
351
|
-
|
|
352
347
|
//#endregion
|
|
353
|
-
export { Job, JobFailed, JobName, ManuallyFailedException, MaxAttemptsExceededException, QueueServiceProvider, TimeoutExceededException };
|
|
348
|
+
export { Job, JobFailed, JobName, ManuallyFailedException, MaxAttemptsExceededException, QueueServiceProvider, TimeoutExceededException };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h3ravel/queue",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.15.0-alpha.12",
|
|
4
4
|
"description": "Job queues, workers and broadcasting support system for H3ravel.",
|
|
5
5
|
"h3ravel": {
|
|
6
6
|
"providers": [
|
|
@@ -41,14 +41,14 @@
|
|
|
41
41
|
"laravel"
|
|
42
42
|
],
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@h3ravel/core": "^1.
|
|
45
|
-
"@h3ravel/contracts": "^
|
|
44
|
+
"@h3ravel/core": "^1.29.0-alpha.12",
|
|
45
|
+
"@h3ravel/contracts": "^1.29.0-alpha.12"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"typescript": "^
|
|
48
|
+
"typescript": "^6.0.0"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
|
-
"build": "tsdown --config-loader
|
|
51
|
+
"build": "tsdown --config-loader unrun",
|
|
52
52
|
"dev": "tsx watch src/index.ts",
|
|
53
53
|
"start": "node dist/index.js",
|
|
54
54
|
"lint": "eslint . --ext .ts",
|