@orchestr-sh/orchestr 1.7.4 → 1.9.1
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/README.md +666 -0
- package/dist/Cache/CacheManager.d.ts +109 -0
- package/dist/Cache/CacheManager.d.ts.map +1 -0
- package/dist/Cache/CacheManager.js +181 -0
- package/dist/Cache/CacheManager.js.map +1 -0
- package/dist/Cache/CacheServiceProvider.d.ts +19 -0
- package/dist/Cache/CacheServiceProvider.d.ts.map +1 -0
- package/dist/Cache/CacheServiceProvider.js +71 -0
- package/dist/Cache/CacheServiceProvider.js.map +1 -0
- package/dist/Cache/Contracts/Lock.d.ts +31 -0
- package/dist/Cache/Contracts/Lock.d.ts.map +1 -0
- package/dist/Cache/Contracts/Lock.js +3 -0
- package/dist/Cache/Contracts/Lock.js.map +1 -0
- package/dist/Cache/Contracts/Repository.d.ts +59 -0
- package/dist/Cache/Contracts/Repository.d.ts.map +1 -0
- package/dist/Cache/Contracts/Repository.js +9 -0
- package/dist/Cache/Contracts/Repository.js.map +1 -0
- package/dist/Cache/Contracts/Store.d.ts +51 -0
- package/dist/Cache/Contracts/Store.d.ts.map +1 -0
- package/dist/Cache/Contracts/Store.js +3 -0
- package/dist/Cache/Contracts/Store.js.map +1 -0
- package/dist/Cache/Events/CacheFlushed.d.ts +11 -0
- package/dist/Cache/Events/CacheFlushed.d.ts.map +1 -0
- package/dist/Cache/Events/CacheFlushed.js +18 -0
- package/dist/Cache/Events/CacheFlushed.js.map +1 -0
- package/dist/Cache/Events/CacheHit.d.ts +13 -0
- package/dist/Cache/Events/CacheHit.d.ts.map +1 -0
- package/dist/Cache/Events/CacheHit.js +22 -0
- package/dist/Cache/Events/CacheHit.js.map +1 -0
- package/dist/Cache/Events/CacheMissed.d.ts +12 -0
- package/dist/Cache/Events/CacheMissed.d.ts.map +1 -0
- package/dist/Cache/Events/CacheMissed.js +20 -0
- package/dist/Cache/Events/CacheMissed.js.map +1 -0
- package/dist/Cache/Events/KeyForgotten.d.ts +12 -0
- package/dist/Cache/Events/KeyForgotten.d.ts.map +1 -0
- package/dist/Cache/Events/KeyForgotten.js +20 -0
- package/dist/Cache/Events/KeyForgotten.js.map +1 -0
- package/dist/Cache/Events/KeyWritten.d.ts +14 -0
- package/dist/Cache/Events/KeyWritten.d.ts.map +1 -0
- package/dist/Cache/Events/KeyWritten.js +24 -0
- package/dist/Cache/Events/KeyWritten.js.map +1 -0
- package/dist/Cache/Events/index.d.ts +6 -0
- package/dist/Cache/Events/index.d.ts.map +1 -0
- package/dist/Cache/Events/index.js +14 -0
- package/dist/Cache/Events/index.js.map +1 -0
- package/dist/Cache/Locks/CacheLock.d.ts +19 -0
- package/dist/Cache/Locks/CacheLock.d.ts.map +1 -0
- package/dist/Cache/Locks/CacheLock.js +49 -0
- package/dist/Cache/Locks/CacheLock.js.map +1 -0
- package/dist/Cache/Locks/Lock.d.ts +51 -0
- package/dist/Cache/Locks/Lock.d.ts.map +1 -0
- package/dist/Cache/Locks/Lock.js +83 -0
- package/dist/Cache/Locks/Lock.js.map +1 -0
- package/dist/Cache/Locks/LockTimeoutException.d.ts +9 -0
- package/dist/Cache/Locks/LockTimeoutException.d.ts.map +1 -0
- package/dist/Cache/Locks/LockTimeoutException.js +16 -0
- package/dist/Cache/Locks/LockTimeoutException.js.map +1 -0
- package/dist/Cache/Locks/index.d.ts +4 -0
- package/dist/Cache/Locks/index.d.ts.map +1 -0
- package/dist/Cache/Locks/index.js +10 -0
- package/dist/Cache/Locks/index.js.map +1 -0
- package/dist/Cache/Repository.d.ts +61 -0
- package/dist/Cache/Repository.d.ts.map +1 -0
- package/dist/Cache/Repository.js +207 -0
- package/dist/Cache/Repository.js.map +1 -0
- package/dist/Cache/Stores/ArrayStore.d.ts +44 -0
- package/dist/Cache/Stores/ArrayStore.d.ts.map +1 -0
- package/dist/Cache/Stores/ArrayStore.js +118 -0
- package/dist/Cache/Stores/ArrayStore.js.map +1 -0
- package/dist/Cache/Stores/DatabaseStore.d.ts +44 -0
- package/dist/Cache/Stores/DatabaseStore.d.ts.map +1 -0
- package/dist/Cache/Stores/DatabaseStore.js +165 -0
- package/dist/Cache/Stores/DatabaseStore.js.map +1 -0
- package/dist/Cache/Stores/FileStore.d.ts +50 -0
- package/dist/Cache/Stores/FileStore.d.ts.map +1 -0
- package/dist/Cache/Stores/FileStore.js +194 -0
- package/dist/Cache/Stores/FileStore.js.map +1 -0
- package/dist/Cache/Stores/NullStore.d.ts +22 -0
- package/dist/Cache/Stores/NullStore.d.ts.map +1 -0
- package/dist/Cache/Stores/NullStore.js +49 -0
- package/dist/Cache/Stores/NullStore.js.map +1 -0
- package/dist/Cache/Stores/index.d.ts +5 -0
- package/dist/Cache/Stores/index.d.ts.map +1 -0
- package/dist/Cache/Stores/index.js +12 -0
- package/dist/Cache/Stores/index.js.map +1 -0
- package/dist/Cache/Tags/TagSet.d.ts +39 -0
- package/dist/Cache/Tags/TagSet.d.ts.map +1 -0
- package/dist/Cache/Tags/TagSet.js +72 -0
- package/dist/Cache/Tags/TagSet.js.map +1 -0
- package/dist/Cache/Tags/TaggedCache.d.ts +54 -0
- package/dist/Cache/Tags/TaggedCache.d.ts.map +1 -0
- package/dist/Cache/Tags/TaggedCache.js +125 -0
- package/dist/Cache/Tags/TaggedCache.js.map +1 -0
- package/dist/Cache/Tags/index.d.ts +3 -0
- package/dist/Cache/Tags/index.d.ts.map +1 -0
- package/dist/Cache/Tags/index.js +8 -0
- package/dist/Cache/Tags/index.js.map +1 -0
- package/dist/Cache/index.d.ts +27 -0
- package/dist/Cache/index.d.ts.map +1 -0
- package/dist/Cache/index.js +48 -0
- package/dist/Cache/index.js.map +1 -0
- package/dist/Console/Commands/CacheClearCommand.d.ts +16 -0
- package/dist/Console/Commands/CacheClearCommand.d.ts.map +1 -0
- package/dist/Console/Commands/CacheClearCommand.js +33 -0
- package/dist/Console/Commands/CacheClearCommand.js.map +1 -0
- package/dist/Console/Commands/CacheForgetCommand.d.ts +16 -0
- package/dist/Console/Commands/CacheForgetCommand.d.ts.map +1 -0
- package/dist/Console/Commands/CacheForgetCommand.js +39 -0
- package/dist/Console/Commands/CacheForgetCommand.js.map +1 -0
- package/dist/Console/Commands/CacheTableCommand.d.ts +17 -0
- package/dist/Console/Commands/CacheTableCommand.d.ts.map +1 -0
- package/dist/Console/Commands/CacheTableCommand.js +92 -0
- package/dist/Console/Commands/CacheTableCommand.js.map +1 -0
- package/dist/Console/Commands/MakeJobCommand.d.ts +20 -0
- package/dist/Console/Commands/MakeJobCommand.d.ts.map +1 -0
- package/dist/Console/Commands/MakeJobCommand.js +165 -0
- package/dist/Console/Commands/MakeJobCommand.js.map +1 -0
- package/dist/Console/Commands/QueueBatchesTableCommand.d.ts +17 -0
- package/dist/Console/Commands/QueueBatchesTableCommand.d.ts.map +1 -0
- package/dist/Console/Commands/QueueBatchesTableCommand.js +92 -0
- package/dist/Console/Commands/QueueBatchesTableCommand.js.map +1 -0
- package/dist/Console/Commands/QueueClearCommand.d.ts +16 -0
- package/dist/Console/Commands/QueueClearCommand.d.ts.map +1 -0
- package/dist/Console/Commands/QueueClearCommand.js +29 -0
- package/dist/Console/Commands/QueueClearCommand.js.map +1 -0
- package/dist/Console/Commands/QueueFailedCommand.d.ts +18 -0
- package/dist/Console/Commands/QueueFailedCommand.d.ts.map +1 -0
- package/dist/Console/Commands/QueueFailedCommand.js +76 -0
- package/dist/Console/Commands/QueueFailedCommand.js.map +1 -0
- package/dist/Console/Commands/QueueFailedTableCommand.d.ts +17 -0
- package/dist/Console/Commands/QueueFailedTableCommand.d.ts.map +1 -0
- package/dist/Console/Commands/QueueFailedTableCommand.js +89 -0
- package/dist/Console/Commands/QueueFailedTableCommand.js.map +1 -0
- package/dist/Console/Commands/QueueFlushCommand.d.ts +18 -0
- package/dist/Console/Commands/QueueFlushCommand.d.ts.map +1 -0
- package/dist/Console/Commands/QueueFlushCommand.js +44 -0
- package/dist/Console/Commands/QueueFlushCommand.js.map +1 -0
- package/dist/Console/Commands/QueueForgetCommand.d.ts +18 -0
- package/dist/Console/Commands/QueueForgetCommand.d.ts.map +1 -0
- package/dist/Console/Commands/QueueForgetCommand.js +48 -0
- package/dist/Console/Commands/QueueForgetCommand.js.map +1 -0
- package/dist/Console/Commands/QueueMonitorCommand.d.ts +16 -0
- package/dist/Console/Commands/QueueMonitorCommand.d.ts.map +1 -0
- package/dist/Console/Commands/QueueMonitorCommand.js +42 -0
- package/dist/Console/Commands/QueueMonitorCommand.js.map +1 -0
- package/dist/Console/Commands/QueuePruneBatchesCommand.d.ts +16 -0
- package/dist/Console/Commands/QueuePruneBatchesCommand.d.ts.map +1 -0
- package/dist/Console/Commands/QueuePruneBatchesCommand.js +44 -0
- package/dist/Console/Commands/QueuePruneBatchesCommand.js.map +1 -0
- package/dist/Console/Commands/QueuePruneFailedCommand.d.ts +18 -0
- package/dist/Console/Commands/QueuePruneFailedCommand.d.ts.map +1 -0
- package/dist/Console/Commands/QueuePruneFailedCommand.js +39 -0
- package/dist/Console/Commands/QueuePruneFailedCommand.js.map +1 -0
- package/dist/Console/Commands/QueueRestartCommand.d.ts +16 -0
- package/dist/Console/Commands/QueueRestartCommand.d.ts.map +1 -0
- package/dist/Console/Commands/QueueRestartCommand.js +34 -0
- package/dist/Console/Commands/QueueRestartCommand.js.map +1 -0
- package/dist/Console/Commands/QueueRetryCommand.d.ts +20 -0
- package/dist/Console/Commands/QueueRetryCommand.d.ts.map +1 -0
- package/dist/Console/Commands/QueueRetryCommand.js +77 -0
- package/dist/Console/Commands/QueueRetryCommand.js.map +1 -0
- package/dist/Console/Commands/QueueTableCommand.d.ts +17 -0
- package/dist/Console/Commands/QueueTableCommand.d.ts.map +1 -0
- package/dist/Console/Commands/QueueTableCommand.js +89 -0
- package/dist/Console/Commands/QueueTableCommand.js.map +1 -0
- package/dist/Console/Commands/QueueWorkCommand.d.ts +16 -0
- package/dist/Console/Commands/QueueWorkCommand.d.ts.map +1 -0
- package/dist/Console/Commands/QueueWorkCommand.js +51 -0
- package/dist/Console/Commands/QueueWorkCommand.js.map +1 -0
- package/dist/Facades/Bus.d.ts +62 -0
- package/dist/Facades/Bus.d.ts.map +1 -0
- package/dist/Facades/Bus.js +102 -0
- package/dist/Facades/Bus.js.map +1 -0
- package/dist/Facades/Cache.d.ts +41 -0
- package/dist/Facades/Cache.d.ts.map +1 -0
- package/dist/Facades/Cache.js +78 -0
- package/dist/Facades/Cache.js.map +1 -0
- package/dist/Facades/Queue.d.ts +42 -0
- package/dist/Facades/Queue.d.ts.map +1 -0
- package/dist/Facades/Queue.js +71 -0
- package/dist/Facades/Queue.js.map +1 -0
- package/dist/Facades/index.d.ts +3 -0
- package/dist/Facades/index.d.ts.map +1 -1
- package/dist/Facades/index.js +7 -1
- package/dist/Facades/index.js.map +1 -1
- package/dist/Queue/Batching/Batch.d.ts +86 -0
- package/dist/Queue/Batching/Batch.d.ts.map +1 -0
- package/dist/Queue/Batching/Batch.js +170 -0
- package/dist/Queue/Batching/Batch.js.map +1 -0
- package/dist/Queue/Batching/PendingBatch.d.ts +72 -0
- package/dist/Queue/Batching/PendingBatch.d.ts.map +1 -0
- package/dist/Queue/Batching/PendingBatch.js +122 -0
- package/dist/Queue/Batching/PendingBatch.js.map +1 -0
- package/dist/Queue/Batching/index.d.ts +3 -0
- package/dist/Queue/Batching/index.d.ts.map +1 -0
- package/dist/Queue/Batching/index.js +8 -0
- package/dist/Queue/Batching/index.js.map +1 -0
- package/dist/Queue/Concerns/Dispatchable.d.ts +36 -0
- package/dist/Queue/Concerns/Dispatchable.d.ts.map +1 -0
- package/dist/Queue/Concerns/Dispatchable.js +102 -0
- package/dist/Queue/Concerns/Dispatchable.js.map +1 -0
- package/dist/Queue/Contracts/QueueDriver.d.ts +67 -0
- package/dist/Queue/Contracts/QueueDriver.d.ts.map +1 -0
- package/dist/Queue/Contracts/QueueDriver.js +9 -0
- package/dist/Queue/Contracts/QueueDriver.js.map +1 -0
- package/dist/Queue/Contracts/QueueableJob.d.ts +74 -0
- package/dist/Queue/Contracts/QueueableJob.d.ts.map +1 -0
- package/dist/Queue/Contracts/QueueableJob.js +9 -0
- package/dist/Queue/Contracts/QueueableJob.js.map +1 -0
- package/dist/Queue/Contracts/ShouldBeUnique.d.ts +43 -0
- package/dist/Queue/Contracts/ShouldBeUnique.d.ts.map +1 -0
- package/dist/Queue/Contracts/ShouldBeUnique.js +12 -0
- package/dist/Queue/Contracts/ShouldBeUnique.js.map +1 -0
- package/dist/Queue/Drivers/DatabaseDriver.d.ts +39 -0
- package/dist/Queue/Drivers/DatabaseDriver.d.ts.map +1 -0
- package/dist/Queue/Drivers/DatabaseDriver.js +176 -0
- package/dist/Queue/Drivers/DatabaseDriver.js.map +1 -0
- package/dist/Queue/Drivers/NullDriver.d.ts +30 -0
- package/dist/Queue/Drivers/NullDriver.d.ts.map +1 -0
- package/dist/Queue/Drivers/NullDriver.js +57 -0
- package/dist/Queue/Drivers/NullDriver.js.map +1 -0
- package/dist/Queue/Drivers/SyncDriver.d.ts +29 -0
- package/dist/Queue/Drivers/SyncDriver.d.ts.map +1 -0
- package/dist/Queue/Drivers/SyncDriver.js +67 -0
- package/dist/Queue/Drivers/SyncDriver.js.map +1 -0
- package/dist/Queue/Drivers/index.d.ts +4 -0
- package/dist/Queue/Drivers/index.d.ts.map +1 -0
- package/dist/Queue/Drivers/index.js +10 -0
- package/dist/Queue/Drivers/index.js.map +1 -0
- package/dist/Queue/Events/JobExceptionOccurred.d.ts +13 -0
- package/dist/Queue/Events/JobExceptionOccurred.d.ts.map +1 -0
- package/dist/Queue/Events/JobExceptionOccurred.js +20 -0
- package/dist/Queue/Events/JobExceptionOccurred.js.map +1 -0
- package/dist/Queue/Events/JobFailed.d.ts +13 -0
- package/dist/Queue/Events/JobFailed.d.ts.map +1 -0
- package/dist/Queue/Events/JobFailed.js +20 -0
- package/dist/Queue/Events/JobFailed.js.map +1 -0
- package/dist/Queue/Events/JobProcessed.d.ts +12 -0
- package/dist/Queue/Events/JobProcessed.d.ts.map +1 -0
- package/dist/Queue/Events/JobProcessed.js +18 -0
- package/dist/Queue/Events/JobProcessed.js.map +1 -0
- package/dist/Queue/Events/JobProcessing.d.ts +12 -0
- package/dist/Queue/Events/JobProcessing.d.ts.map +1 -0
- package/dist/Queue/Events/JobProcessing.js +18 -0
- package/dist/Queue/Events/JobProcessing.js.map +1 -0
- package/dist/Queue/Events/JobQueued.d.ts +14 -0
- package/dist/Queue/Events/JobQueued.d.ts.map +1 -0
- package/dist/Queue/Events/JobQueued.js +22 -0
- package/dist/Queue/Events/JobQueued.js.map +1 -0
- package/dist/Queue/Events/JobRetryRequested.d.ts +12 -0
- package/dist/Queue/Events/JobRetryRequested.d.ts.map +1 -0
- package/dist/Queue/Events/JobRetryRequested.js +20 -0
- package/dist/Queue/Events/JobRetryRequested.js.map +1 -0
- package/dist/Queue/Events/WorkerStopping.d.ts +11 -0
- package/dist/Queue/Events/WorkerStopping.d.ts.map +1 -0
- package/dist/Queue/Events/WorkerStopping.js +18 -0
- package/dist/Queue/Events/WorkerStopping.js.map +1 -0
- package/dist/Queue/Events/index.d.ts +8 -0
- package/dist/Queue/Events/index.d.ts.map +1 -0
- package/dist/Queue/Events/index.js +18 -0
- package/dist/Queue/Events/index.js.map +1 -0
- package/dist/Queue/Failed/DatabaseFailedJobProvider.d.ts +33 -0
- package/dist/Queue/Failed/DatabaseFailedJobProvider.d.ts.map +1 -0
- package/dist/Queue/Failed/DatabaseFailedJobProvider.js +100 -0
- package/dist/Queue/Failed/DatabaseFailedJobProvider.js.map +1 -0
- package/dist/Queue/Failed/FailedJobProvider.d.ts +42 -0
- package/dist/Queue/Failed/FailedJobProvider.d.ts.map +1 -0
- package/dist/Queue/Failed/FailedJobProvider.js +9 -0
- package/dist/Queue/Failed/FailedJobProvider.js.map +1 -0
- package/dist/Queue/Job.d.ts +194 -0
- package/dist/Queue/Job.d.ts.map +1 -0
- package/dist/Queue/Job.js +286 -0
- package/dist/Queue/Job.js.map +1 -0
- package/dist/Queue/JobPayload.d.ts +37 -0
- package/dist/Queue/JobPayload.d.ts.map +1 -0
- package/dist/Queue/JobPayload.js +46 -0
- package/dist/Queue/JobPayload.js.map +1 -0
- package/dist/Queue/Middleware/JobMiddleware.d.ts +29 -0
- package/dist/Queue/Middleware/JobMiddleware.d.ts.map +1 -0
- package/dist/Queue/Middleware/JobMiddleware.js +21 -0
- package/dist/Queue/Middleware/JobMiddleware.js.map +1 -0
- package/dist/Queue/Middleware/RateLimited.d.ts +56 -0
- package/dist/Queue/Middleware/RateLimited.d.ts.map +1 -0
- package/dist/Queue/Middleware/RateLimited.js +83 -0
- package/dist/Queue/Middleware/RateLimited.js.map +1 -0
- package/dist/Queue/Middleware/ThrottlesExceptions.d.ts +71 -0
- package/dist/Queue/Middleware/ThrottlesExceptions.d.ts.map +1 -0
- package/dist/Queue/Middleware/ThrottlesExceptions.js +119 -0
- package/dist/Queue/Middleware/ThrottlesExceptions.js.map +1 -0
- package/dist/Queue/Middleware/WithoutOverlapping.d.ts +64 -0
- package/dist/Queue/Middleware/WithoutOverlapping.d.ts.map +1 -0
- package/dist/Queue/Middleware/WithoutOverlapping.js +103 -0
- package/dist/Queue/Middleware/WithoutOverlapping.js.map +1 -0
- package/dist/Queue/Middleware/index.d.ts +5 -0
- package/dist/Queue/Middleware/index.d.ts.map +1 -0
- package/dist/Queue/Middleware/index.js +10 -0
- package/dist/Queue/Middleware/index.js.map +1 -0
- package/dist/Queue/PendingChain.d.ts +63 -0
- package/dist/Queue/PendingChain.d.ts.map +1 -0
- package/dist/Queue/PendingChain.js +111 -0
- package/dist/Queue/PendingChain.js.map +1 -0
- package/dist/Queue/PendingDispatch.d.ts +66 -0
- package/dist/Queue/PendingDispatch.d.ts.map +1 -0
- package/dist/Queue/PendingDispatch.js +101 -0
- package/dist/Queue/PendingDispatch.js.map +1 -0
- package/dist/Queue/QueueManager.d.ts +151 -0
- package/dist/Queue/QueueManager.d.ts.map +1 -0
- package/dist/Queue/QueueManager.js +227 -0
- package/dist/Queue/QueueManager.js.map +1 -0
- package/dist/Queue/QueueServiceProvider.d.ts +19 -0
- package/dist/Queue/QueueServiceProvider.d.ts.map +1 -0
- package/dist/Queue/QueueServiceProvider.js +75 -0
- package/dist/Queue/QueueServiceProvider.js.map +1 -0
- package/dist/Queue/Workers/Worker.d.ts +99 -0
- package/dist/Queue/Workers/Worker.d.ts.map +1 -0
- package/dist/Queue/Workers/Worker.js +324 -0
- package/dist/Queue/Workers/Worker.js.map +1 -0
- package/dist/Queue/Workers/WorkerOptions.d.ts +62 -0
- package/dist/Queue/Workers/WorkerOptions.d.ts.map +1 -0
- package/dist/Queue/Workers/WorkerOptions.js +23 -0
- package/dist/Queue/Workers/WorkerOptions.js.map +1 -0
- package/dist/Queue/index.d.ts +41 -0
- package/dist/Queue/index.d.ts.map +1 -0
- package/dist/Queue/index.js +67 -0
- package/dist/Queue/index.js.map +1 -0
- package/dist/index.d.ts +75 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +141 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dispatchable Concern for Jobs
|
|
3
|
+
*
|
|
4
|
+
* Provides static dispatch methods for Job classes.
|
|
5
|
+
* Similar to the Event Dispatchable mixin, but for queue jobs.
|
|
6
|
+
*/
|
|
7
|
+
import { PendingDispatch } from '../PendingDispatch';
|
|
8
|
+
export declare class JobDispatchable {
|
|
9
|
+
/**
|
|
10
|
+
* Dispatch the job with the given arguments
|
|
11
|
+
*
|
|
12
|
+
* @returns PendingDispatch for fluent configuration
|
|
13
|
+
*/
|
|
14
|
+
static dispatch(...args: any[]): PendingDispatch;
|
|
15
|
+
/**
|
|
16
|
+
* Dispatch the job synchronously (bypass queue)
|
|
17
|
+
*/
|
|
18
|
+
static dispatchSync(...args: any[]): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Dispatch the job if the given condition is true
|
|
21
|
+
*/
|
|
22
|
+
static dispatchIf(condition: boolean | (() => boolean), ...args: any[]): PendingDispatch | null;
|
|
23
|
+
/**
|
|
24
|
+
* Dispatch the job unless the given condition is true
|
|
25
|
+
*/
|
|
26
|
+
static dispatchUnless(condition: boolean | (() => boolean), ...args: any[]): PendingDispatch | null;
|
|
27
|
+
/**
|
|
28
|
+
* Dispatch the job after the response is sent to the browser
|
|
29
|
+
*/
|
|
30
|
+
static dispatchAfterResponse(...args: any[]): void;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Apply JobDispatchable mixin to a Job class
|
|
34
|
+
*/
|
|
35
|
+
export declare function applyJobDispatchable(jobClass: any): void;
|
|
36
|
+
//# sourceMappingURL=Dispatchable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dispatchable.d.ts","sourceRoot":"","sources":["../../../src/Queue/Concerns/Dispatchable.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGrD,qBAAa,eAAe;IAC1B;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,eAAe;IAWhD;;OAEG;WACU,YAAY,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAWxD;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,OAAO,GAAG,CAAC,MAAM,OAAO,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,eAAe,GAAG,IAAI;IAU/F;;OAEG;IACH,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,OAAO,GAAG,CAAC,MAAM,OAAO,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,eAAe,GAAG,IAAI;IAUnG;;OAEG;IACH,MAAM,CAAC,qBAAqB,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;CAkBnD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,GAAG,GAAG,IAAI,CAmBxD"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Dispatchable Concern for Jobs
|
|
4
|
+
*
|
|
5
|
+
* Provides static dispatch methods for Job classes.
|
|
6
|
+
* Similar to the Event Dispatchable mixin, but for queue jobs.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.JobDispatchable = void 0;
|
|
10
|
+
exports.applyJobDispatchable = applyJobDispatchable;
|
|
11
|
+
const Facade_1 = require("../../Support/Facade");
|
|
12
|
+
const PendingDispatch_1 = require("../PendingDispatch");
|
|
13
|
+
class JobDispatchable {
|
|
14
|
+
/**
|
|
15
|
+
* Dispatch the job with the given arguments
|
|
16
|
+
*
|
|
17
|
+
* @returns PendingDispatch for fluent configuration
|
|
18
|
+
*/
|
|
19
|
+
static dispatch(...args) {
|
|
20
|
+
const app = Facade_1.Facade.getFacadeApplication();
|
|
21
|
+
if (!app) {
|
|
22
|
+
throw new Error('Application not initialized. Cannot dispatch job.');
|
|
23
|
+
}
|
|
24
|
+
const manager = app.make('queue');
|
|
25
|
+
const instance = new this(...args);
|
|
26
|
+
return new PendingDispatch_1.PendingDispatch(manager, instance);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Dispatch the job synchronously (bypass queue)
|
|
30
|
+
*/
|
|
31
|
+
static async dispatchSync(...args) {
|
|
32
|
+
const app = Facade_1.Facade.getFacadeApplication();
|
|
33
|
+
if (!app) {
|
|
34
|
+
throw new Error('Application not initialized. Cannot dispatch job.');
|
|
35
|
+
}
|
|
36
|
+
const manager = app.make('queue');
|
|
37
|
+
const instance = new this(...args);
|
|
38
|
+
await manager.dispatchSync(instance);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Dispatch the job if the given condition is true
|
|
42
|
+
*/
|
|
43
|
+
static dispatchIf(condition, ...args) {
|
|
44
|
+
const shouldDispatch = typeof condition === 'function' ? condition() : condition;
|
|
45
|
+
if (shouldDispatch) {
|
|
46
|
+
return this.dispatch(...args);
|
|
47
|
+
}
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Dispatch the job unless the given condition is true
|
|
52
|
+
*/
|
|
53
|
+
static dispatchUnless(condition, ...args) {
|
|
54
|
+
const shouldNotDispatch = typeof condition === 'function' ? condition() : condition;
|
|
55
|
+
if (!shouldNotDispatch) {
|
|
56
|
+
return this.dispatch(...args);
|
|
57
|
+
}
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Dispatch the job after the response is sent to the browser
|
|
62
|
+
*/
|
|
63
|
+
static dispatchAfterResponse(...args) {
|
|
64
|
+
const app = Facade_1.Facade.getFacadeApplication();
|
|
65
|
+
if (!app) {
|
|
66
|
+
throw new Error('Application not initialized. Cannot dispatch job.');
|
|
67
|
+
}
|
|
68
|
+
const manager = app.make('queue');
|
|
69
|
+
const instance = new this(...args);
|
|
70
|
+
// Use setImmediate/nextTick to execute after the current response
|
|
71
|
+
setImmediate(async () => {
|
|
72
|
+
try {
|
|
73
|
+
await manager.dispatchSync(instance);
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
console.error(`[Queue] Failed to dispatch after response: ${instance.displayName()}`, error);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.JobDispatchable = JobDispatchable;
|
|
82
|
+
/**
|
|
83
|
+
* Apply JobDispatchable mixin to a Job class
|
|
84
|
+
*/
|
|
85
|
+
function applyJobDispatchable(jobClass) {
|
|
86
|
+
const staticMethods = Object.getOwnPropertyNames(JobDispatchable);
|
|
87
|
+
for (const name of staticMethods) {
|
|
88
|
+
if (name === 'constructor' || name === 'prototype' || name === 'length' || name === 'name') {
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
const descriptor = Object.getOwnPropertyDescriptor(JobDispatchable, name);
|
|
92
|
+
if (descriptor) {
|
|
93
|
+
Object.defineProperty(jobClass, name, {
|
|
94
|
+
value: descriptor.value,
|
|
95
|
+
enumerable: false,
|
|
96
|
+
configurable: true,
|
|
97
|
+
writable: true,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=Dispatchable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dispatchable.js","sourceRoot":"","sources":["../../../src/Queue/Concerns/Dispatchable.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAyFH,oDAmBC;AA1GD,iDAA8C;AAC9C,wDAAqD;AAGrD,MAAa,eAAe;IAC1B;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAW;QAC5B,MAAM,GAAG,GAAG,eAAM,CAAC,oBAAoB,EAAE,CAAC;QAC1C,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;QACvE,CAAC;QAED,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,CAAe,OAAO,CAAC,CAAC;QAChD,MAAM,QAAQ,GAAG,IAAK,IAAY,CAAC,GAAG,IAAI,CAAC,CAAC;QAC5C,OAAO,IAAI,iCAAe,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAChD,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,IAAW;QACtC,MAAM,GAAG,GAAG,eAAM,CAAC,oBAAoB,EAAE,CAAC;QAC1C,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;QACvE,CAAC;QAED,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,CAAe,OAAO,CAAC,CAAC;QAChD,MAAM,QAAQ,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;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,KAAK,CAAC,8CAA8C,QAAQ,CAAC,WAAW,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;YAC/F,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA9ED,0CA8EC;AAED;;GAEG;AACH,SAAgB,oBAAoB,CAAC,QAAa;IAChD,MAAM,aAAa,GAAG,MAAM,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC;IAElE,KAAK,MAAM,IAAI,IAAI,aAAa,EAAE,CAAC;QACjC,IAAI,IAAI,KAAK,aAAa,IAAI,IAAI,KAAK,WAAW,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;YAC3F,SAAS;QACX,CAAC;QAED,MAAM,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;QAE1E,IAAI,UAAU,EAAE,CAAC;YACf,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,EAAE;gBACpC,KAAK,EAAE,UAAU,CAAC,KAAK;gBACvB,UAAU,EAAE,KAAK;gBACjB,YAAY,EAAE,IAAI;gBAClB,QAAQ,EAAE,IAAI;aACf,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QueueDriver Contract
|
|
3
|
+
*
|
|
4
|
+
* Defines the interface for queue driver implementations.
|
|
5
|
+
* Mirrors Laravel's Illuminate\Contracts\Queue\Queue interface.
|
|
6
|
+
*/
|
|
7
|
+
import type { Job } from '../Job';
|
|
8
|
+
export interface QueueDriverJob {
|
|
9
|
+
id: string;
|
|
10
|
+
queue: string;
|
|
11
|
+
payload: string;
|
|
12
|
+
attempts: number;
|
|
13
|
+
reservedAt: number | null;
|
|
14
|
+
availableAt: number;
|
|
15
|
+
createdAt: number;
|
|
16
|
+
}
|
|
17
|
+
export interface QueueDriver {
|
|
18
|
+
/**
|
|
19
|
+
* Get the size of the queue
|
|
20
|
+
*/
|
|
21
|
+
size(queue?: string): Promise<number>;
|
|
22
|
+
/**
|
|
23
|
+
* Push a new job onto the queue
|
|
24
|
+
*/
|
|
25
|
+
push(job: Job, queue?: string): Promise<string>;
|
|
26
|
+
/**
|
|
27
|
+
* Push a raw payload onto the queue
|
|
28
|
+
*/
|
|
29
|
+
pushRaw(payload: string, queue?: string, options?: Record<string, any>): Promise<string>;
|
|
30
|
+
/**
|
|
31
|
+
* Push a new job onto the queue after a delay
|
|
32
|
+
*/
|
|
33
|
+
later(delay: number | Date, job: Job, queue?: string): Promise<string>;
|
|
34
|
+
/**
|
|
35
|
+
* Push an array of jobs onto the queue
|
|
36
|
+
*/
|
|
37
|
+
bulk(jobs: Job[], queue?: string): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Pop the next job off of the queue
|
|
40
|
+
*/
|
|
41
|
+
pop(queue?: string): Promise<QueueDriverJob | null>;
|
|
42
|
+
/**
|
|
43
|
+
* Release a reserved job back onto the queue
|
|
44
|
+
*/
|
|
45
|
+
release(id: string, delay?: number): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Delete a reserved job
|
|
48
|
+
*/
|
|
49
|
+
delete(id: string): Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* Delete all of the jobs from the queue
|
|
52
|
+
*/
|
|
53
|
+
clear(queue?: string): Promise<number>;
|
|
54
|
+
/**
|
|
55
|
+
* Get the connection name for the queue
|
|
56
|
+
*/
|
|
57
|
+
getConnectionName(): string;
|
|
58
|
+
/**
|
|
59
|
+
* Set the connection name for the queue
|
|
60
|
+
*/
|
|
61
|
+
setConnectionName(name: string): void;
|
|
62
|
+
/**
|
|
63
|
+
* Get the default queue name
|
|
64
|
+
*/
|
|
65
|
+
getQueue(queue?: string): string;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=QueueDriver.d.ts.map
|
|
@@ -0,0 +1 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AAO,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnD;;OAEG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElC;;OAEG;IACH,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEvC;;OAEG;IACH,iBAAiB,IAAI,MAAM,CAAC;IAE5B;;OAEG;IACH,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtC;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAClC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* QueueDriver Contract
|
|
4
|
+
*
|
|
5
|
+
* Defines the interface for queue driver implementations.
|
|
6
|
+
* Mirrors Laravel's Illuminate\Contracts\Queue\Queue interface.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
//# sourceMappingURL=QueueDriver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueueDriver.js","sourceRoot":"","sources":["../../../src/Queue/Contracts/QueueDriver.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QueueableJob Contract
|
|
3
|
+
*
|
|
4
|
+
* Defines the interface for all queueable jobs in the system.
|
|
5
|
+
* Mirrors Laravel's Illuminate\Contracts\Queue\Job interface.
|
|
6
|
+
*/
|
|
7
|
+
import type { JobMiddleware } from '../Middleware/JobMiddleware';
|
|
8
|
+
export interface QueueableJob {
|
|
9
|
+
/**
|
|
10
|
+
* The unique identifier for the job
|
|
11
|
+
*/
|
|
12
|
+
uuid?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The name of the connection the job should be sent to
|
|
15
|
+
*/
|
|
16
|
+
connection?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The name of the queue the job should be sent to
|
|
19
|
+
*/
|
|
20
|
+
queue?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The number of seconds before the job should be processed
|
|
23
|
+
*/
|
|
24
|
+
delay?: number | Date;
|
|
25
|
+
/**
|
|
26
|
+
* The number of times the job may be attempted
|
|
27
|
+
*/
|
|
28
|
+
tries?: number;
|
|
29
|
+
/**
|
|
30
|
+
* The maximum number of unhandled exceptions to allow before failing
|
|
31
|
+
*/
|
|
32
|
+
maxExceptions?: number;
|
|
33
|
+
/**
|
|
34
|
+
* The number of seconds the job can run before timing out
|
|
35
|
+
*/
|
|
36
|
+
timeout?: number;
|
|
37
|
+
/**
|
|
38
|
+
* The number of seconds to wait before retrying the job
|
|
39
|
+
*/
|
|
40
|
+
backoff?: number | number[];
|
|
41
|
+
/**
|
|
42
|
+
* The timestamp after which the job should no longer be retried
|
|
43
|
+
*/
|
|
44
|
+
retryUntil?: Date;
|
|
45
|
+
/**
|
|
46
|
+
* Indicate if the job should be marked as failed on timeout
|
|
47
|
+
*/
|
|
48
|
+
failOnTimeout?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Indicate if the job should be dispatched after all database transactions have committed
|
|
51
|
+
*/
|
|
52
|
+
afterCommit?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Get the display name of the job
|
|
55
|
+
*/
|
|
56
|
+
displayName(): string;
|
|
57
|
+
/**
|
|
58
|
+
* Execute the job
|
|
59
|
+
*/
|
|
60
|
+
handle(...args: any[]): Promise<void> | void;
|
|
61
|
+
/**
|
|
62
|
+
* Handle a job failure
|
|
63
|
+
*/
|
|
64
|
+
failed?(error: Error): Promise<void> | void;
|
|
65
|
+
/**
|
|
66
|
+
* Get the middleware the job should pass through
|
|
67
|
+
*/
|
|
68
|
+
middleware?(): JobMiddleware[];
|
|
69
|
+
/**
|
|
70
|
+
* Serialize the job for storage
|
|
71
|
+
*/
|
|
72
|
+
toJSON(): Record<string, any>;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=QueueableJob.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueueableJob.d.ts","sourceRoot":"","sources":["../../../src/Queue/Contracts/QueueableJob.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE5B;;OAEG;IACH,UAAU,CAAC,EAAE,IAAI,CAAC;IAElB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,WAAW,IAAI,MAAM,CAAC;IAEtB;;OAEG;IACH,MAAM,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAE7C;;OAEG;IACH,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAE5C;;OAEG;IACH,UAAU,CAAC,IAAI,aAAa,EAAE,CAAC;IAE/B;;OAEG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC/B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* QueueableJob Contract
|
|
4
|
+
*
|
|
5
|
+
* Defines the interface for all queueable jobs in the system.
|
|
6
|
+
* Mirrors Laravel's Illuminate\Contracts\Queue\Job interface.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
//# sourceMappingURL=QueueableJob.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueueableJob.js","sourceRoot":"","sources":["../../../src/Queue/Contracts/QueueableJob.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ShouldBeUnique Contract
|
|
3
|
+
*
|
|
4
|
+
* When a job implements this interface, the queue system will
|
|
5
|
+
* ensure that only one instance of the job with the same unique
|
|
6
|
+
* ID is on the queue at any given time.
|
|
7
|
+
*
|
|
8
|
+
* Mirrors Laravel's Illuminate\Contracts\Queue\ShouldBeUnique.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* class UpdateSearchIndex extends Job implements ShouldBeUnique {
|
|
13
|
+
* public uniqueFor = 3600; // Lock for 1 hour
|
|
14
|
+
*
|
|
15
|
+
* uniqueId(): string {
|
|
16
|
+
* return `search-index-${this.productId}`;
|
|
17
|
+
* }
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export interface ShouldBeUnique {
|
|
22
|
+
/**
|
|
23
|
+
* The unique ID used to prevent duplicate jobs
|
|
24
|
+
*/
|
|
25
|
+
uniqueId(): string;
|
|
26
|
+
/**
|
|
27
|
+
* The number of seconds after which the unique lock will be released
|
|
28
|
+
*/
|
|
29
|
+
uniqueFor?: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* ShouldBeUniqueUntilProcessing Contract
|
|
33
|
+
*
|
|
34
|
+
* Similar to ShouldBeUnique, but the lock is released when
|
|
35
|
+
* the job begins processing rather than when it completes.
|
|
36
|
+
*/
|
|
37
|
+
export interface ShouldBeUniqueUntilProcessing extends ShouldBeUnique {
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Type guard to check if a job implements ShouldBeUnique
|
|
41
|
+
*/
|
|
42
|
+
export declare function isShouldBeUnique(job: any): job is ShouldBeUnique;
|
|
43
|
+
//# sourceMappingURL=ShouldBeUnique.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShouldBeUnique.d.ts","sourceRoot":"","sources":["../../../src/Queue/Contracts/ShouldBeUnique.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,QAAQ,IAAI,MAAM,CAAC;IAEnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,MAAM,WAAW,6BAA8B,SAAQ,cAAc;CAAG;AAExE;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,cAAc,CAMhE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isShouldBeUnique = isShouldBeUnique;
|
|
4
|
+
/**
|
|
5
|
+
* Type guard to check if a job implements ShouldBeUnique
|
|
6
|
+
*/
|
|
7
|
+
function isShouldBeUnique(job) {
|
|
8
|
+
return (job !== null &&
|
|
9
|
+
typeof job === 'object' &&
|
|
10
|
+
typeof job.uniqueId === 'function');
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=ShouldBeUnique.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShouldBeUnique.js","sourceRoot":"","sources":["../../../src/Queue/Contracts/ShouldBeUnique.ts"],"names":[],"mappings":";;AA2CA,4CAMC;AATD;;GAEG;AACH,SAAgB,gBAAgB,CAAC,GAAQ;IACvC,OAAO,CACL,GAAG,KAAK,IAAI;QACZ,OAAO,GAAG,KAAK,QAAQ;QACvB,OAAO,GAAG,CAAC,QAAQ,KAAK,UAAU,CACnC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DatabaseDriver
|
|
3
|
+
*
|
|
4
|
+
* Database queue driver that stores jobs in a database table.
|
|
5
|
+
* This is the most common driver for most applications.
|
|
6
|
+
*
|
|
7
|
+
* Mirrors Laravel's Illuminate\Queue\DatabaseQueue.
|
|
8
|
+
*/
|
|
9
|
+
import type { QueueDriver, QueueDriverJob } from '../Contracts/QueueDriver';
|
|
10
|
+
import type { Job } from '../Job';
|
|
11
|
+
import type { QueueConnectionConfig } from '../QueueManager';
|
|
12
|
+
import type { Application } from '../../Foundation/Application';
|
|
13
|
+
import type { Connection } from '../../Database/Connection';
|
|
14
|
+
export declare class DatabaseDriver implements QueueDriver {
|
|
15
|
+
protected config: QueueConnectionConfig;
|
|
16
|
+
protected app: Application;
|
|
17
|
+
protected connectionName: string;
|
|
18
|
+
protected defaultQueue: string;
|
|
19
|
+
protected table: string;
|
|
20
|
+
protected retryAfter: number;
|
|
21
|
+
constructor(config: QueueConnectionConfig, app: Application);
|
|
22
|
+
/**
|
|
23
|
+
* Get the database connection
|
|
24
|
+
*/
|
|
25
|
+
protected getConnection(): Connection;
|
|
26
|
+
size(queue?: string): Promise<number>;
|
|
27
|
+
push(job: Job, queue?: string): Promise<string>;
|
|
28
|
+
pushRaw(payload: string, queue?: string, options?: Record<string, any>): Promise<string>;
|
|
29
|
+
later(delay: number | Date, job: Job, queue?: string): Promise<string>;
|
|
30
|
+
bulk(jobs: Job[], queue?: string): Promise<void>;
|
|
31
|
+
pop(queue?: string): Promise<QueueDriverJob | null>;
|
|
32
|
+
release(id: string, delay?: number): Promise<void>;
|
|
33
|
+
delete(id: string): Promise<void>;
|
|
34
|
+
clear(queue?: string): Promise<number>;
|
|
35
|
+
getConnectionName(): string;
|
|
36
|
+
setConnectionName(name: string): void;
|
|
37
|
+
getQueue(queue?: string): string;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=DatabaseDriver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatabaseDriver.d.ts","sourceRoot":"","sources":["../../../src/Queue/Drivers/DatabaseDriver.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAElC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D,qBAAa,cAAe,YAAW,WAAW;IAO9C,SAAS,CAAC,MAAM,EAAE,qBAAqB;IACvC,SAAS,CAAC,GAAG,EAAE,WAAW;IAP5B,SAAS,CAAC,cAAc,EAAE,MAAM,CAAc;IAC9C,SAAS,CAAC,YAAY,EAAE,MAAM,CAAC;IAC/B,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,UAAU,EAAE,MAAM,CAAC;gBAGjB,MAAM,EAAE,qBAAqB,EAC7B,GAAG,EAAE,WAAW;IAO5B;;OAEG;IACH,SAAS,CAAC,aAAa,IAAI,UAAU;IAK/B,IAAI,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAWrC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAmB/C,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;IAmBxF,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IA0BtE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMhD,GAAG,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IA8CnD,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,GAAE,MAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAYrD,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQjC,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAa5C,iBAAiB,IAAI,MAAM;IAI3B,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIrC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM;CAGjC"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* DatabaseDriver
|
|
4
|
+
*
|
|
5
|
+
* Database queue driver that stores jobs in a database table.
|
|
6
|
+
* This is the most common driver for most applications.
|
|
7
|
+
*
|
|
8
|
+
* Mirrors Laravel's Illuminate\Queue\DatabaseQueue.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.DatabaseDriver = void 0;
|
|
12
|
+
const crypto_1 = require("crypto");
|
|
13
|
+
const JobPayload_1 = require("../JobPayload");
|
|
14
|
+
class DatabaseDriver {
|
|
15
|
+
config;
|
|
16
|
+
app;
|
|
17
|
+
connectionName = 'database';
|
|
18
|
+
defaultQueue;
|
|
19
|
+
table;
|
|
20
|
+
retryAfter;
|
|
21
|
+
constructor(config, app) {
|
|
22
|
+
this.config = config;
|
|
23
|
+
this.app = app;
|
|
24
|
+
this.defaultQueue = config.queue || 'default';
|
|
25
|
+
this.table = config.table || 'jobs';
|
|
26
|
+
this.retryAfter = config.retry_after || 90;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Get the database connection
|
|
30
|
+
*/
|
|
31
|
+
getConnection() {
|
|
32
|
+
const db = this.app.make('db');
|
|
33
|
+
return db.connection(this.config.connection);
|
|
34
|
+
}
|
|
35
|
+
async size(queue) {
|
|
36
|
+
const queueName = this.getQueue(queue);
|
|
37
|
+
const connection = this.getConnection();
|
|
38
|
+
const result = await connection.table(this.table)
|
|
39
|
+
.where('queue', '=', queueName)
|
|
40
|
+
.count();
|
|
41
|
+
return Number(result) || 0;
|
|
42
|
+
}
|
|
43
|
+
async push(job, queue) {
|
|
44
|
+
const queueName = this.getQueue(queue);
|
|
45
|
+
const payload = JobPayload_1.JobPayload.create(job);
|
|
46
|
+
const now = Math.floor(Date.now() / 1000);
|
|
47
|
+
const connection = this.getConnection();
|
|
48
|
+
await connection.table(this.table).insert({
|
|
49
|
+
queue: queueName,
|
|
50
|
+
payload: JobPayload_1.JobPayload.serialize(payload),
|
|
51
|
+
attempts: 0,
|
|
52
|
+
reserved_at: null,
|
|
53
|
+
available_at: now,
|
|
54
|
+
created_at: now,
|
|
55
|
+
});
|
|
56
|
+
return payload.uuid;
|
|
57
|
+
}
|
|
58
|
+
async pushRaw(payload, queue, options) {
|
|
59
|
+
const queueName = this.getQueue(queue);
|
|
60
|
+
const now = Math.floor(Date.now() / 1000);
|
|
61
|
+
const delay = options?.delay || 0;
|
|
62
|
+
const connection = this.getConnection();
|
|
63
|
+
await connection.table(this.table).insert({
|
|
64
|
+
queue: queueName,
|
|
65
|
+
payload,
|
|
66
|
+
attempts: 0,
|
|
67
|
+
reserved_at: null,
|
|
68
|
+
available_at: now + delay,
|
|
69
|
+
created_at: now,
|
|
70
|
+
});
|
|
71
|
+
return (0, crypto_1.randomUUID)();
|
|
72
|
+
}
|
|
73
|
+
async later(delay, job, queue) {
|
|
74
|
+
const queueName = this.getQueue(queue);
|
|
75
|
+
const payload = JobPayload_1.JobPayload.create(job);
|
|
76
|
+
const now = Math.floor(Date.now() / 1000);
|
|
77
|
+
let availableAt;
|
|
78
|
+
if (delay instanceof Date) {
|
|
79
|
+
availableAt = Math.floor(delay.getTime() / 1000);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
availableAt = now + delay;
|
|
83
|
+
}
|
|
84
|
+
const connection = this.getConnection();
|
|
85
|
+
await connection.table(this.table).insert({
|
|
86
|
+
queue: queueName,
|
|
87
|
+
payload: JobPayload_1.JobPayload.serialize(payload),
|
|
88
|
+
attempts: 0,
|
|
89
|
+
reserved_at: null,
|
|
90
|
+
available_at: availableAt,
|
|
91
|
+
created_at: now,
|
|
92
|
+
});
|
|
93
|
+
return payload.uuid;
|
|
94
|
+
}
|
|
95
|
+
async bulk(jobs, queue) {
|
|
96
|
+
for (const job of jobs) {
|
|
97
|
+
await this.push(job, queue);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
async pop(queue) {
|
|
101
|
+
const queueName = this.getQueue(queue);
|
|
102
|
+
const now = Math.floor(Date.now() / 1000);
|
|
103
|
+
const connection = this.getConnection();
|
|
104
|
+
// Find the next available job
|
|
105
|
+
// First, expire any reserved jobs that have been held too long
|
|
106
|
+
await connection.table(this.table)
|
|
107
|
+
.where('queue', '=', queueName)
|
|
108
|
+
.where('reserved_at', '<=', now - this.retryAfter)
|
|
109
|
+
.update({
|
|
110
|
+
reserved_at: null,
|
|
111
|
+
});
|
|
112
|
+
// Get the next available job and reserve it
|
|
113
|
+
const job = await connection.table(this.table)
|
|
114
|
+
.where('queue', '=', queueName)
|
|
115
|
+
.where('available_at', '<=', now)
|
|
116
|
+
.whereNull('reserved_at')
|
|
117
|
+
.orderBy('id', 'asc')
|
|
118
|
+
.limit(1)
|
|
119
|
+
.first();
|
|
120
|
+
if (!job) {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
// Reserve the job
|
|
124
|
+
await connection.table(this.table)
|
|
125
|
+
.where('id', '=', job.id)
|
|
126
|
+
.update({
|
|
127
|
+
reserved_at: now,
|
|
128
|
+
attempts: (job.attempts || 0) + 1,
|
|
129
|
+
});
|
|
130
|
+
return {
|
|
131
|
+
id: String(job.id),
|
|
132
|
+
queue: job.queue,
|
|
133
|
+
payload: job.payload,
|
|
134
|
+
attempts: (job.attempts || 0) + 1,
|
|
135
|
+
reservedAt: now,
|
|
136
|
+
availableAt: job.available_at,
|
|
137
|
+
createdAt: job.created_at,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
async release(id, delay = 0) {
|
|
141
|
+
const now = Math.floor(Date.now() / 1000);
|
|
142
|
+
const connection = this.getConnection();
|
|
143
|
+
await connection.table(this.table)
|
|
144
|
+
.where('id', '=', id)
|
|
145
|
+
.update({
|
|
146
|
+
reserved_at: null,
|
|
147
|
+
available_at: now + delay,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
async delete(id) {
|
|
151
|
+
const connection = this.getConnection();
|
|
152
|
+
await connection.table(this.table)
|
|
153
|
+
.where('id', '=', id)
|
|
154
|
+
.delete();
|
|
155
|
+
}
|
|
156
|
+
async clear(queue) {
|
|
157
|
+
const queueName = this.getQueue(queue);
|
|
158
|
+
const connection = this.getConnection();
|
|
159
|
+
const count = await this.size(queueName);
|
|
160
|
+
await connection.table(this.table)
|
|
161
|
+
.where('queue', '=', queueName)
|
|
162
|
+
.delete();
|
|
163
|
+
return count;
|
|
164
|
+
}
|
|
165
|
+
getConnectionName() {
|
|
166
|
+
return this.connectionName;
|
|
167
|
+
}
|
|
168
|
+
setConnectionName(name) {
|
|
169
|
+
this.connectionName = name;
|
|
170
|
+
}
|
|
171
|
+
getQueue(queue) {
|
|
172
|
+
return queue || this.defaultQueue;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
exports.DatabaseDriver = DatabaseDriver;
|
|
176
|
+
//# sourceMappingURL=DatabaseDriver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatabaseDriver.js","sourceRoot":"","sources":["../../../src/Queue/Drivers/DatabaseDriver.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH,mCAAoC;AAGpC,8CAA2C;AAM3C,MAAa,cAAc;IAOb;IACA;IAPF,cAAc,GAAW,UAAU,CAAC;IACpC,YAAY,CAAS;IACrB,KAAK,CAAS;IACd,UAAU,CAAS;IAE7B,YACY,MAA6B,EAC7B,GAAgB;QADhB,WAAM,GAAN,MAAM,CAAuB;QAC7B,QAAG,GAAH,GAAG,CAAa;QAE1B,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,KAAK,IAAI,SAAS,CAAC;QAC9C,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC;QACpC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,WAAW,IAAI,EAAE,CAAC;IAC7C,CAAC;IAED;;OAEG;IACO,aAAa;QACrB,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAkB,IAAI,CAAC,CAAC;QAChD,OAAO,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,KAAc;QACvB,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACvC,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;QAExC,M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AG,IAAI,CAAC,aAAa,EAAE,CAAC;QAExC,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAEzC,MAAM,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;aAC/B,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,SAAS,CAAC;aAC9B,MAAM,EAAE,CAAC;QAEZ,OAAO,KAAK,CAAC;IACf,CAAC;IAED,iBAAiB;QACf,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAED,iBAAiB,CAAC,IAAY;QAC5B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;IAC7B,CAAC;IAED,QAAQ,CAAC,KAAc;QACrB,OAAO,KAAK,IAAI,IAAI,CAAC,YAAY,CAAC;IACpC,CAAC;CACF;AAlMD,wCAkMC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NullDriver
|
|
3
|
+
*
|
|
4
|
+
* Null queue driver that discards all jobs.
|
|
5
|
+
* Useful for testing when you want to verify jobs are dispatched
|
|
6
|
+
* but don't want them to actually execute.
|
|
7
|
+
*
|
|
8
|
+
* Mirrors Laravel's Illuminate\Queue\NullQueue.
|
|
9
|
+
*/
|
|
10
|
+
import type { QueueDriver, QueueDriverJob } from '../Contracts/QueueDriver';
|
|
11
|
+
import type { Job } from '../Job';
|
|
12
|
+
import type { QueueConnectionConfig } from '../QueueManager';
|
|
13
|
+
export declare class NullDriver implements QueueDriver {
|
|
14
|
+
protected config: QueueConnectionConfig;
|
|
15
|
+
protected connectionName: string;
|
|
16
|
+
constructor(config: QueueConnectionConfig);
|
|
17
|
+
size(_queue?: string): Promise<number>;
|
|
18
|
+
push(job: Job, _queue?: string): Promise<string>;
|
|
19
|
+
pushRaw(_payload: string, _queue?: string, _options?: Record<string, any>): Promise<string>;
|
|
20
|
+
later(_delay: number | Date, job: Job, _queue?: string): Promise<string>;
|
|
21
|
+
bulk(_jobs: Job[], _queue?: string): Promise<void>;
|
|
22
|
+
pop(_queue?: string): Promise<QueueDriverJob | null>;
|
|
23
|
+
release(_id: string, _delay?: number): Promise<void>;
|
|
24
|
+
delete(_id: string): Promise<void>;
|
|
25
|
+
clear(_queue?: string): Promise<number>;
|
|
26
|
+
getConnectionName(): string;
|
|
27
|
+
setConnectionName(name: string): void;
|
|
28
|
+
getQueue(queue?: string): string;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=NullDriver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NullDriver.d.ts","sourceRoot":"","sources":["../../../src/Queue/Drivers/NullDriver.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE7D,qBAAa,UAAW,YAAW,WAAW;IAGhC,SAAS,CAAC,MAAM,EAAE,qBAAqB;IAFnD,SAAS,CAAC,cAAc,EAAE,MAAM,CAAU;gBAEpB,MAAM,EAAE,qBAAqB;IAE7C,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAItC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAIhD,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;IAI3F,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MA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