-
Notifications
You must be signed in to change notification settings - Fork 421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve documentation grammar, format, etc. #2158
Conversation
## Delaying | ||
|
||
There are situations when it is valuable to delay a job when it is being processed. | ||
There are situations when it is useful to delay a job when it is being processed. | ||
|
||
This can be handled using the `moveToDelayed` method. However, it is important to note that when a job is being processed by a worker, the worker keeps a lock on this job with a certain token value. For the `moveToDelayed` method to work, we need to pass said token so that it can unlock without error. Finally, we need to exit from the processor by throwing a special error `DelayedError` that will signal the worker that the job has been delayed so that it does not try to complete (or fail the job) instead. | ||
This can be handled using the `moveToDelayed` method. However, it is important to note that when a job is being processed by a worker, the worker keeps a lock on this job with a certain token value. For the `moveToDelayed` method to work, we need to pass said token so that it can unlock without error. Finally, we need to exit from the processor by throwing a special error (`DelayedError`) that will signal to the worker that the job has been delayed so that it does not try to complete (or fail the job) instead. | ||
|
||
```typescript | ||
import { DelayedError, Worker } from 'bullmq'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this section needs to be audited by someone with more familiarity with moveToDelayed
and DelayedError
.
The code example uses moveToDelayed
in one branch and throws DelayedError
in the other branch, but this is different from the following example of moveToWaitingChildren
and WaitingChildrenError
, which are used in the same branch. Moreover, the description does not make it clear what the intended usage is.
This makes minor changes to the documentation, mostly consisting of small grammar and spelling fixes, as well as formatting, and some rewording.
3930ac5
to
f814d5b
Compare
@@ -4,11 +4,11 @@ description: Processing jobs in batches | |||
|
|||
# Batches | |||
|
|||
It is possible to configure the workers so that instead of processing one job at a time they can process up to a number of jobs (a so-called batch) in one go. | |||
It is possible to configure workers so that instead of processing one job at a time they can process up to a number of jobs (a so-called _batch_) in one go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure "the" is not needed here? I am no native english speaker but it sounds wrong without the "the"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, chatGPT did indeed provide me with the answer :)
Thank you for this gigantic effort, very much appreciated! |
This makes minor changes to the documentation, mostly consisting of small grammar and spelling fixes, as well as formatting, and some rewording.
I was reading through the documentation and noticed a few things, so I figured I'd fix them. I kept thinking I was close to the end of the documentation, so I might as well keep going... There was more than I thought, but I did skim through all of it.
Note that I am a new user of BullMQ, so I can not be sure if the content is actually correct (except in cases where it was obvious). This just aims to improve the language used.