-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce1c058
commit 9cd59f9
Showing
1 changed file
with
68 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<h1 align="center">hyper-adapter-queue</h1> | ||
<h1 align="center">hyper-adapter-bullmq</h1> | ||
<p align="center">A Queue port adapter for BullMQ in the <a href="https://hyper.io/">hyper</a> service framework</p> | ||
</p> | ||
<p align="center"> | ||
|
@@ -11,50 +11,101 @@ | |
<!-- toc --> | ||
|
||
- [Getting Started](#getting-started) | ||
- [Installation](#installation) | ||
- [Methods](#methods) | ||
- [Contributing](#contributing) | ||
- [Testing](#testing) | ||
- [License](#license) | ||
|
||
<!-- tocstop --> | ||
|
||
## Getting Started | ||
|
||
TODO | ||
|
||
## Installation | ||
```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', | ||
}), | ||
], | ||
}, | ||
], | ||
} | ||
``` | ||
|
||
TODO | ||
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://docs.hyper.io/queue-api) adapter | ||
|
||
See the full port [here](https://nest.land/package/hyper-port-queue) | ||
[hyper Queue service](https://hyper63.github.io/docs/docs/api-reference/rest/queue.html) adapter | ||
## Contributing | ||
|
||
Contributions are welcome! See the hyper | ||
[contribution guide](https://docs.hyper.io/oss/contributing-to-hyper) | ||
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 | ||
``` | ||
To lint, check formatting, and run unit tests | ||
|
||
## License | ||
Apache-2.0 |