@shrub/queue 0.5.58 → 0.5.59

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.
Files changed (2) hide show
  1. package/dist/queue.d.ts +8 -8
  2. package/package.json +4 -4
package/dist/queue.d.ts CHANGED
@@ -2,14 +2,6 @@ import { IEvent } from "@sprig/event-emitter";
2
2
  export declare type WorkerCallback<TData = any> = (job: IJob<TData>) => Promise<void | any>;
3
3
  /** Defines the API for a queue. */
4
4
  export interface IQueue {
5
- /** An event that is raised when a job has become active. */
6
- readonly onJobActive: IEvent<IJobActiveEventArgs>;
7
- /** An event that is raised when a job has completed. */
8
- readonly onJobCompleted: IEvent<IJobCompletedEventArgs>;
9
- /** An event that is raised when a job has failed. */
10
- readonly onJobFailed: IEvent<IJobFailedEventArgs>;
11
- /** An event that is raised when a job has reported progress. */
12
- readonly onJobProgress: IEvent<IJobProgressEventArgs>;
13
5
  /** Adds a job to the queue. */
14
6
  add<TData = any>(options: IJobOptions<TData>): Promise<IJob<TData>>;
15
7
  /** Closes the queue and all workers associated with the queue. */
@@ -58,6 +50,14 @@ export interface IWorkerOptions<TData = any> {
58
50
  }
59
51
  /** Defines a worker responsible for processing jobs. */
60
52
  export interface IWorker {
53
+ /** An event that is raised when a job has becomes active. */
54
+ readonly onJobActive: IEvent<IJobActiveEventArgs>;
55
+ /** An event that is raised when a job has completed. */
56
+ readonly onJobCompleted: IEvent<IJobCompletedEventArgs>;
57
+ /** An event that is raised when a job has failed. */
58
+ readonly onJobFailed: IEvent<IJobFailedEventArgs>;
59
+ /** An event that is raised when a job has reported progress. */
60
+ readonly onJobProgress: IEvent<IJobProgressEventArgs>;
61
61
  /** Closes the worker and all underlying connections. */
62
62
  close(): Promise<void>;
63
63
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shrub/queue",
3
3
  "description": "Provides a basic abstraction and support for job/task queues.",
4
- "version": "0.5.58",
4
+ "version": "0.5.59",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -25,9 +25,9 @@
25
25
  "test": "jest"
26
26
  },
27
27
  "dependencies": {
28
- "@shrub/core": "0.5.58",
29
- "@shrub/logging": "0.5.58",
28
+ "@shrub/core": "0.5.59",
29
+ "@shrub/logging": "0.5.59",
30
30
  "@sprig/event-emitter": "^0.2.0"
31
31
  },
32
- "gitHead": "4af976e3b4276487f8661ae89d8de06aa4757481"
32
+ "gitHead": "be17fea967675b2b1cc5411debd4e276dbd46d05"
33
33
  }