minor improvements to ui component docs (#2805)
* minor improvements to ui component docs * polish queue.mdx, remove duplicate icon
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user