-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
837e1f7
commit 33261de
Showing
14 changed files
with
365 additions
and
367 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,3 @@ benchmarks | |
.idea | ||
bin | ||
out | ||
.nyc_output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
declare module '@ioc:Rocketseat/Bull' { | ||
import { Queue, Processor, JobsOptions, QueueOptions, WorkerOptions, Job } from 'bullmq' | ||
import { Queue, Processor, JobsOptions, QueueOptions, WorkerOptions, Job } from 'bullmq' | ||
|
||
export interface JobContract<T = any> { | ||
key: string | ||
options?: JobsOptions | ||
workerOptions?: WorkerOptions | ||
queueOptions?: QueueOptions | ||
concurrency?: number | ||
handle(data: T): Promise<any> | ||
boot?: (queue: Queue) => void | ||
} | ||
export interface JobContract<T = any> { | ||
key: string | ||
options?: JobsOptions | ||
workerOptions?: WorkerOptions | ||
queueOptions?: QueueOptions | ||
concurrency?: number | ||
handle(data: T): Promise<any> | ||
boot?: (queue: Queue) => void | ||
} | ||
|
||
export interface QueueContract<T = any> extends JobContract<T> { | ||
bull: Queue<T> | ||
} | ||
export interface QueueContract<T = any> extends JobContract<T> { | ||
bull: Queue<T> | ||
} | ||
|
||
export interface BullManagerContract { | ||
queues: { [key: string]: QueueContract } | ||
export interface BullManagerContract { | ||
queues: { [key: string]: QueueContract } | ||
|
||
getByKey(key: string): QueueContract | ||
getByKey(key: string): QueueContract | ||
|
||
add<T>(name: string, data: T, jobOptions?: JobsOptions): Promise<Job<any, any>> | ||
add<T>(name: string, data: T, jobOptions?: JobsOptions): Promise<Job<any, any>> | ||
|
||
remove(name: string, jobId: string): Promise<void> | ||
remove(name: string, jobId: string): Promise<void> | ||
|
||
ui(port?: number): void | ||
ui(port?: number): void | ||
|
||
shutdown(): Promise<void> | ||
shutdown(): Promise<void> | ||
|
||
process(): void | ||
} | ||
process(): void | ||
} | ||
|
||
const Bull: BullManagerContract | ||
const Bull: BullManagerContract | ||
|
||
export default Bull | ||
export default Bull | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.