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
Showing
33 changed files
with
310 additions
and
108 deletions.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [bullmq](./bullmq.md) > [Job](./bullmq.job.md) > [parent](./bullmq.job.parent.md) | ||
|
||
## Job.parent property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
parent?: { | ||
id: string; | ||
queueKey: string; | ||
}; | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [bullmq](./bullmq.md) > [JobData](./bullmq.jobdata.md) | ||
|
||
## JobData type | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare type JobData = [JobJsonRaw | number, string?]; | ||
``` | ||
<b>References:</b> [JobJsonRaw](./bullmq.jobjsonraw.md) | ||
|
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [bullmq](./bullmq.md) > [JobJsonRaw](./bullmq.jobjsonraw.md) > [parent](./bullmq.jobjsonraw.parent.md) | ||
|
||
## JobJsonRaw.parent property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
parent?: string; | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [bullmq](./bullmq.md) > [raw2jobData](./bullmq.raw2jobdata.md) | ||
|
||
## raw2jobData() function | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare function raw2jobData(raw: any[]): [JobJsonRaw | number, string?] | []; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| raw | any\[\] | | | ||
|
||
<b>Returns:</b> | ||
|
||
\[[JobJsonRaw](./bullmq.jobjsonraw.md) \| number, string?\] \| \[\] | ||
|
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [bullmq](./bullmq.md) > [Worker\_2](./bullmq.worker_2.md) > [createJob](./bullmq.worker_2.createjob.md) | ||
|
||
## Worker\_2.createJob() method | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
protected createJob(data: JobJsonRaw, jobId: string): Job<any, any, string>; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| data | [JobJsonRaw](./bullmq.jobjsonraw.md) | | | ||
| jobId | string | | | ||
|
||
<b>Returns:</b> | ||
|
||
[Job](./bullmq.job.md)<!-- --><any, any, string> | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Rate limiting | ||
|
||
A useful feature when using groups is to be able to rate limit the groups independently of each other, so you can evenly process the jobs belonging to many groups and still limit how many jobs per group are allowed to be processed by unit of time. | ||
|
||
The way the rate limiting works is that when the jobs for a given group exceed the maximum amount of jobs per unit of time that particular group gets rate limited. The jobs that belongs to this particular group will not be processed until the rate limit expires. | ||
|
||
For example "group 2" is rate limited in the following chart: | ||
|
||
![Rate limited group](<../../.gitbook/assets/image (3).png>) | ||
|
||
While one or more groups are rate limited, the rest of the jobs belonging to non rate limited groups will continue to be consumed normally or until they also get rate limited. | ||
|
||
The rate limit is configured on the worker instances: | ||
|
||
```typescript | ||
import { WorkerPro } from '@taskforcesh/bullmq-pro'; | ||
|
||
const worker = new WorkerPro('myQueue', processFn, { | ||
groups: { | ||
limit: { | ||
max: 100, // Limit to 100 jobs per second per group | ||
duration 1000, | ||
} | ||
}, | ||
connection | ||
}); | ||
``` | ||
|
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Observables | ||
|
||
Instead of returning regular promises, you can also return an Observable, this allows for some more advanced uses cases: | ||
|
||
* It makes possible to cleanly cancel a running job. | ||
* You can define a "Time to live" (TTL) so that jobs that take too long time will be automatically cancelled. | ||
* Since the last value returned by the observable is persisted, you could retry a job and continue where you left of, for example if the job implements a state machine or similar. | ||
|
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.