Skip to content
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

Merged
merged 3 commits into from
Nov 18, 2023

Conversation

sambostock
Copy link
Contributor

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.

Comment on lines 83 to 90
## 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';
Copy link
Contributor Author

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.
@sambostock sambostock changed the title Tweak documentation (grammar, format, etc.) Improve documentation grammar, format, etc. Aug 29, 2023
sambostock and others added 2 commits November 9, 2023 10:51
@@ -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.
Copy link
Contributor

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"

Copy link
Contributor

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 :)

@manast manast merged commit 25090ab into taskforcesh:master Nov 18, 2023
11 checks passed
@manast
Copy link
Contributor

manast commented Nov 18, 2023

Thank you for this gigantic effort, very much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants