@stacksjs/queue 0.70.36 → 0.70.42
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/src/job.d.ts +13 -4
- package/dist/src/utils.d.ts +2 -0
- package/package.json +1 -1
package/dist/src/job.d.ts
CHANGED
|
@@ -72,18 +72,27 @@ export declare function runJob(name: string, options?: { payload?: any; context?
|
|
|
72
72
|
* // Immediate (synchronous) execution, ignoring the queue
|
|
73
73
|
* await Jobs.dispatchNow('SendNotification', { message: 'Hello' })
|
|
74
74
|
* ```
|
|
75
|
+
* @defaultValue
|
|
76
|
+
* ```ts
|
|
77
|
+
* {
|
|
78
|
+
* dispatch: () => unknown,
|
|
79
|
+
* dispatchIf: () => unknown,
|
|
80
|
+
* dispatchUnless: () => unknown,
|
|
81
|
+
* dispatchNow: () => unknown
|
|
82
|
+
* }
|
|
83
|
+
* ```
|
|
75
84
|
*/
|
|
76
85
|
export declare const Jobs: {
|
|
77
86
|
/** Construct a builder without dispatching — for chained option calls. */
|
|
78
87
|
make: (name: string, payload?: any) => JobBuilder;
|
|
79
88
|
/** Dispatch a job in one call. Equivalent to `job(name, payload).dispatch()`. */
|
|
80
|
-
|
|
89
|
+
dispatch: (name: string, payload?: any) => Promise<void>;
|
|
81
90
|
/** Dispatch only if `condition` is truthy. */
|
|
82
|
-
|
|
91
|
+
dispatchIf: (condition: boolean, name: string, payload?: any) => Promise<void>;
|
|
83
92
|
/** Dispatch unless `condition` is truthy. */
|
|
84
|
-
|
|
93
|
+
dispatchUnless: (condition: boolean, name: string, payload?: any) => Promise<void>;
|
|
85
94
|
/** Run the job synchronously, bypassing the queue. */
|
|
86
|
-
|
|
95
|
+
dispatchNow: (name: string, payload?: any) => Promise<void>;
|
|
87
96
|
/** Schedule the job to run after `seconds` of delay. */
|
|
88
97
|
dispatchAfter: (seconds: number, name: string, payload?: any) => JobBuilder
|
|
89
98
|
};
|