From bd64c4663ce956d24e4b2d37134416ba5f344899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?rogger=20andr=C3=A9=20valverde=20flores?= Date: Wed, 29 Jun 2022 20:48:34 -0500 Subject: [PATCH] docs: add new api references --- docs/gitbook/guide/architecture.md | 4 ++-- docs/gitbook/guide/flows/README.md | 8 ++++---- docs/gitbook/guide/jobs/README.md | 4 ++-- docs/gitbook/guide/jobs/fifo.md | 3 +-- docs/gitbook/guide/workers/graceful-shutdown.md | 5 +---- docs/gitbook/guide/workers/pausing-queues.md | 3 +-- 6 files changed, 11 insertions(+), 16 deletions(-) diff --git a/docs/gitbook/guide/architecture.md b/docs/gitbook/guide/architecture.md index 3c44f644a1..3cd2fbf39b 100644 --- a/docs/gitbook/guide/architecture.md +++ b/docs/gitbook/guide/architecture.md @@ -6,7 +6,7 @@ description: >- # Architecture -In order to use the full potential of Bull queues, it is important to understand the lifecycle of a job. From the moment a producer calls the [`add`](../api/bullmq.queue.add.md) method on a queue instance, a job enters a lifecycle where it will be in different states, until its completion or failure (although technically a failed job could be retried and get a new lifecycle). +In order to use the full potential of Bull queues, it is important to understand the lifecycle of a job. From the moment a producer calls the [`add`](https://api.docs.bullmq.io/classes/Queue.html#add) method on a queue instance, a job enters a lifecycle where it will be in different states, until its completion or failure (although technically a failed job could be retried and get a new lifecycle). ![Lifecycle of a job - Queue](<../.gitbook/assets/architecture (1).png>) @@ -34,7 +34,7 @@ When a job is added to a queue it can be in one of two states, it can either be The next state for a job is the “active” state. The active state is represented by a set, and are jobs that are currently being processed, i.e. they are running in the `process` function explained in the previous chapter. A job can be in the active state for an unlimited amount of time until the process is completed or an exception is thrown so that the job will end in either the “completed” or the “failed” status. -Another way to add a job is by the [`add`](https://github.com/taskforcesh/bullmq/blob/master/docs/gitbook/api/bullmq.flowproducer.add.md) method on a flow producer instance. +Another way to add a job is by the [`add`](https://api.docs.bullmq.io/classes/FlowProducer.html#add) method on a flow producer instance. ![Lifecycle of a job - Flow Producer](../.gitbook/assets/flow-architecture.png) diff --git a/docs/gitbook/guide/flows/README.md b/docs/gitbook/guide/flows/README.md index 6a97864c3e..2386e85734 100644 --- a/docs/gitbook/guide/flows/README.md +++ b/docs/gitbook/guide/flows/README.md @@ -12,7 +12,7 @@ This functionality enables the creation of flows where jobs are the node of tree Flows are added to a queue using the "_FlowProducer_" class. {% endhint %} -In order to create "flows" you must use the [FlowProducer](https://api.docs.bullmq.io/classes/FlowProducer.html) class. The method "_add_" accepts an object with the following interface: +In order to create "flows" you must use the [FlowProducer](https://api.docs.bullmq.io/classes/FlowProducer.html) class. The method [_**add**_](https://api.docs.bullmq.io/classes/FlowProducer.html#add) accepts an object with the following interface: ```typescript interface FlowJob { @@ -193,6 +193,6 @@ await queue.remove(job.id); ## Read more: -* 📋 [Divide large jobs using flows](https://blog.taskforce.sh/splitting-heavy-jobs-using-bullmq-flows/) -* 💡 [FlowProducer API Reference](https://api.docs.bullmq.io/classes/FlowProducer.html) -* 💡 [Job API Reference](https://api.docs.bullmq.io/classes/Job.html) +- 📋 [Divide large jobs using flows](https://blog.taskforce.sh/splitting-heavy-jobs-using-bullmq-flows/) +- 💡 [FlowProducer API Reference](https://api.docs.bullmq.io/classes/FlowProducer.html) +- 💡 [Job API Reference](https://api.docs.bullmq.io/classes/Job.html) diff --git a/docs/gitbook/guide/jobs/README.md b/docs/gitbook/guide/jobs/README.md index 6129a7d444..b2c858ad32 100644 --- a/docs/gitbook/guide/jobs/README.md +++ b/docs/gitbook/guide/jobs/README.md @@ -1,9 +1,9 @@ # Jobs -Queues can hold different types of jobs which determine how and when they are processed. In this section we will describe them in detail. +Queues can hold different types of jobs which determine how and when they are processed. In this section, we will describe them in detail. An important thing to consider is that you can mix the different job types in the same queue, so you can add FIFO jobs, and at any moment add a LIFO or a delayed job. ## Read more: -- 💡 [Job API Reference](https://github.com/taskforcesh/bullmq/blob/master/docs/gitbook/api/bullmq.job.md) +- 💡 [Job API Reference](https://api.docs.bullmq.io/classes/Job.html) diff --git a/docs/gitbook/guide/jobs/fifo.md b/docs/gitbook/guide/jobs/fifo.md index a00055f999..5feb9a6d65 100644 --- a/docs/gitbook/guide/jobs/fifo.md +++ b/docs/gitbook/guide/jobs/fifo.md @@ -7,7 +7,7 @@ description: 'First-In, First-Out' The first type of jobs we are going to describe is the FIFO \(First-In, First-Out\) type. This is the standard type when adding jobs to a queue. The jobs are processed in the order they are inserted into the queue. This order is preserved independently on the amount of processors you have; however, if you have more than one worker or concurrency larger than 1, even though the workers will start the jobs in order, they may be completed in a slightly different order, since some jobs may take more time to complete than others. ```typescript -import { Queue } from 'bullmq' +import { Queue } from 'bullmq'; const myQueue = new Queue('Paint'); @@ -36,4 +36,3 @@ const queue = new Queue('Paint', { defaultJobOptions: { removeOnComplete: true, removeOnFail: 1000 }); ``` - diff --git a/docs/gitbook/guide/workers/graceful-shutdown.md b/docs/gitbook/guide/workers/graceful-shutdown.md index 28245fcc8e..50d660487e 100644 --- a/docs/gitbook/guide/workers/graceful-shutdown.md +++ b/docs/gitbook/guide/workers/graceful-shutdown.md @@ -12,7 +12,4 @@ In order to perform a shutdown just call the _**close**_ method: await worker.close(); ``` -The above call will mark the worker as _closing_ so it will not pick up new jobs, at the same time it will wait for all the current jobs to be processed \(or failed\). This call will not timeout by itself, so you should make sure that your jobs finalize in a timely maner. If this call fails for some reason or it is not able to complete, the pending jobs will be marked as stalled and processed by other workers \(if correct stalled options are configured on the [QueueScheduler](https://github.com/taskforcesh/bullmq/blob/3a8873b6453405e6f8e57331f6cee30977406670/docs/gitbook/api/bullmq.queuescheduleroptions.md)\). - - - +The above call will mark the worker as _closing_ so it will not pick up new jobs, at the same time it will wait for all the current jobs to be processed \(or failed\). This call will not timeout by itself, so you should make sure that your jobs finalize in a timely manner. If this call fails for some reason or it is not able to complete, the pending jobs will be marked as stalled and processed by other workers \(if correct stalled options are configured on the [QueueScheduler](https://api.docs.bullmq.io/interfaces/QueueSchedulerOptions.html)\). diff --git a/docs/gitbook/guide/workers/pausing-queues.md b/docs/gitbook/guide/workers/pausing-queues.md index b3083bb368..103ddbdcbe 100644 --- a/docs/gitbook/guide/workers/pausing-queues.md +++ b/docs/gitbook/guide/workers/pausing-queues.md @@ -2,7 +2,7 @@ BullMQ supports pausing queues globally or locally. A queue is paused globally when no workers will pick up any jobs from the queue. When you pause a queue, the workers that are currently busy processing a job, will continue working on that job until it completes (or failed), and then will just keep idling until the queue has been unpaused. -Pausing a queue is performed by calling the _**pause**_ method on a [queue](../../api/bullmq.queue.md) instance: +Pausing a queue is performed by calling the _**pause**_ method on a [queue](https://api.docs.bullmq.io/classes/Queue.html) instance: ```typescript await myQueue.pause(); @@ -19,4 +19,3 @@ The call above will wait for all the jobs currently being processed by this work ```typescript await myWorker.pause(true); ``` -