An open API service indexing awesome lists of open source software.

https://github.com/hyper63/hyper-adapter-bullmq

BullMQ Queue Adapter for the Hyper Queue Port
https://github.com/hyper63/hyper-adapter-bullmq

bullmq clean-architecture deno hyper ports-and-adapters queue redis service-framework

Last synced: about 2 months ago
JSON representation

BullMQ Queue Adapter for the Hyper Queue Port

Awesome Lists containing this project

README

        

hyper-adapter-bullmq


A Queue port adapter for BullMQ in the hyper service framework


Test
Current Version

---

- [Getting Started](#getting-started)
- [Methods](#methods)
- [Testing](#testing)
- [License](#license)

## Getting Started

```ts
import { default as bullmq } from 'https://raw.githubusercontent.com/hyper63/hyper-adapter-bullmq/v1.0.1/mod.ts'

export default {
app,
adapter: [
{
port: 'queue',
plugins: [
bullmq({
url: 'http://user@[email protected]:6379',
}),
],
},
],
}
```

You can pass the following configuration to the adapter:

```ts
export type AdapterConfig = {
/**
* The redis server connection string
*/
url: string
options?: {
/**
* How many Workers to spawn in order to process jobs.
*
* Defaults to 10
*/
concurrency?: number
/**
* The Time-To-Live for jobs whose processing fails. The job payload,
* along with the error is stored in redis.
*
* Defaults to 7 days.
*/
failedTtl?: number
/**
* A prefix you'd like all keys created by the adapter to use.
*
* Defaults to no prefix ie. ''
*/
keyPrefix?: string
/**
* Whether the Redis Server being used is clustered.
*
* Defaults to false
*/
cluster?: boolean
}
}
```

## Methods

This adapter fully implements the Queue port and can be used as the
[hyper Queue service](https://hyper63.github.io/docs/docs/api-reference/rest/queue.html) adapter

See the full port [here](https://github.com/hyper63/hyper/tree/main/packages/port-queue)

## Testing

Run Tests

```sh
deno task test
```

To lint, check formatting, and run unit tests

Run Integration Tests

> You will need a Redis Server running and `REDIS_URL` set to your Redis server connection string

```sh
deno task test:integration
```

Run Test Harness

```sh
deno task test:harness
```

## License

Apache-2.0