minor improvements to ui component docs (#2805)

* minor improvements to ui component docs

* polish queue.mdx, remove duplicate icon
This commit is contained in:
Nimra Ahmed
2023-12-04 12:32:35 +05:00
committed by GitHub
parent de2f7212d1
commit 2171eff1a0
7 changed files with 20 additions and 18 deletions

View File

@ -2,21 +2,22 @@
title: Message Queue
sidebar_position: 5
sidebar_custom_props:
icon: TbTopologyStar
icon: TbSchema
---
Queues facilitate async operations to be performed.It could be used for performing background tasks such as sending a welcome email on register.
Queues facilitate async operations to be performed. They can be used for performing background tasks such as sending a welcome email on register.
Each use case will have its own queue class extended from `MessageQueueServiceBase`.
Currently queue supports 2 drivers which can be configurred by env variable `MESSAGE_QUEUE_TYPE`
1. `pg-boss` this is the default driver, uses [pg-boss](https://github.com/timgit/pg-boss) under the hood.
2. `bull-mq` it uses [bull-mq](https://bullmq.io/) under the hood.
Currently, queue supports two drivers which can be configurred by env variable `MESSAGE_QUEUE_TYPE`.
1. `pg-boss`: this is the default driver, which uses [pg-boss](https://github.com/timgit/pg-boss) under the hood.
2. `bull-mq`: this uses [bull-mq](https://bullmq.io/) under the hood.
Steps to create and use a new queue
1. add a queue name for your new queue under enum `MESSAGE_QUEUES`.
2. provide factory implementation of the queue with queue name as dependency token.
3. inject the queue that you created in the required module/service with queue name as dependency token.
4. add worker class with token based injection just like producer.
## Steps to create and use a new queue
1. Add a queue name for your new queue under enum `MESSAGE_QUEUES`.
2. Provide the factory implementation of the queue with the queue name as the dependency token.
3. Inject the queue that you created in the required module/service with the queue name as the dependency token.
4. Add worker class with token based injection just like producer.
### Example usage
```ts