Skip to content

Commit

Permalink
chore: merge branch 'master' into fix-clean-differentiate-score
Browse files Browse the repository at this point in the history
  • Loading branch information
roggervalf committed Aug 16, 2023
2 parents 1cb3163 + 75dd80b commit 4ccb045
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 16 deletions.
1 change: 1 addition & 0 deletions docs/gitbook/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
* [Batches](bullmq-pro/batches.md)
* [NestJs](bullmq-pro/nestjs/README.md)
* [Producers](bullmq-pro/nestjs/producers.md)
* [Queue Events Listeners](bullmq-pro/nestjs/queue-events-listeners.md)
* [API Reference](https://nestjs.bullmq.pro/)
* [Changelog](bullmq-pro/nestjs/changelog.md)
* [API Reference](https://api.bullmq.pro)
Expand Down
21 changes: 21 additions & 0 deletions docs/gitbook/bullmq-pro/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
## [6.3.3](https://github.com/taskforcesh/bullmq-pro/compare/v6.3.2...v6.3.3) (2023-08-15)


### Bug Fixes

* **queue:** throw error when name is not provided ([#178](https://github.com/taskforcesh/bullmq-pro/issues/178)) ([9715bf1](https://github.com/taskforcesh/bullmq-pro/commit/9715bf15edef1f54a9ebc618eb7d47c7b45a35ca))

## [6.3.2](https://github.com/taskforcesh/bullmq-pro/compare/v6.3.1...v6.3.2) (2023-08-11)


### Bug Fixes

* correct group rate limit in some edge cases ([#177](https://github.com/taskforcesh/bullmq-pro/issues/177)) ([c3c87a7](https://github.com/taskforcesh/bullmq-pro/commit/c3c87a7f0a6de5c35ac389efbac594d6d987cf49))

## [6.3.1](https://github.com/taskforcesh/bullmq-pro/compare/v6.3.0...v6.3.1) (2023-08-10)


### Performance Improvements

* **rate-limit:** get pttl only if needed ([#175](https://github.com/taskforcesh/bullmq-pro/issues/175)) ([0439823](https://github.com/taskforcesh/bullmq-pro/commit/0439823c32a82e48abcae43c29e50ef912c31d15))

# [6.3.0](https://github.com/taskforcesh/bullmq-pro/compare/v6.2.4...v6.3.0) (2023-08-03)


Expand Down
1 change: 1 addition & 0 deletions docs/gitbook/bullmq-pro/nestjs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,4 @@ A working example is available [here](https://github.com/taskforcesh/nestjs-bull
- 💡 [Queues Technique](https://docs.nestjs.com/techniques/queues)
- 💡 [Register Queue API Reference](https://nestjs.bullmq.pro/classes/BullModule.html#registerQueue)
- 💡 [Register Flow Producer API Reference](https://nestjs.bullmq.pro/classes/BullModule.html#registerFlowProducer)
- 💡 [Worker Listener API Reference](https://api.docs.bullmq.io/interfaces/v4.WorkerListener.html)
2 changes: 2 additions & 0 deletions docs/gitbook/bullmq-pro/nestjs/producers.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Producers

Job producers add jobs to queues. Producers are typically application services (Nest providers). To add jobs to a queue, first inject the queue into the service as follows:

```typescript
Expand Down
49 changes: 49 additions & 0 deletions docs/gitbook/bullmq-pro/nestjs/queue-events-listeners.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Queue Events Listeners

To register a QueueEvents instance, you need to use **QueueEventsListener** decorator:

```typescript
import {
QueueEventsListener,
QueueEventsHost,
OnQueueEvent,
} from '@taskforcesh/nestjs-bullmq-pro';

@QueueEventsListener('queueName')
export class TestQueueEvents extends QueueEventsHost {
@OnQueueEvent('completed')
onCompleted({
jobId,
}: {
jobId: string;
returnvalue: string;
prev?: string;
}) {
// do some stuff
}
}
```

And then register it as a provider:

```typescript
@Module({
imports: [
BullModule.registerQueue({
name: 'queueName',
connection: {
host: '0.0.0.0',
port: 6380,
},
}),
],
providers: [TestQueueEvents],
})
export class AppModule {}
```

## Read more:

- 💡 [Queues Technique](https://docs.nestjs.com/techniques/queues)
- 💡 [Register Queue API Reference](https://nestjs.bullmq.pro/classes/BullModule.html#registerQueue)
- 💡 [Queue Events Pro Listener API Reference](https://api.bullmq.pro/interfaces/v6.QueueEventsListenerPro.html)
11 changes: 0 additions & 11 deletions docs/gitbook/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
## [4.7.1](https://github.com/taskforcesh/bullmq/compare/v4.7.0...v4.7.1) (2023-08-10)


### Features

* **python:** add username option into redisOpts ([#2108](https://github.com/taskforcesh/bullmq/issues/2108)) ([d27f33e](https://github.com/taskforcesh/bullmq/commit/d27f33e997d30e6c0c7d4484bea338347c3fe67e))


### Performance Improvements

* **rate-limit:** get pttl only if needed ([#2129](https://github.com/taskforcesh/bullmq/issues/2129)) ([12ce2f3](https://github.com/taskforcesh/bullmq/commit/12ce2f3746626a81ea961961bb1a629077eed68a))
Expand Down Expand Up @@ -48,11 +43,6 @@
# [4.5.0](https://github.com/taskforcesh/bullmq/compare/v4.4.0...v4.5.0) (2023-07-18)


### Bug Fixes

* **python:** respect concurrency in worker ([#2062](https://github.com/taskforcesh/bullmq/issues/2062)) fixes [#2063](https://github.com/taskforcesh/bullmq/issues/2063) ([1b95185](https://github.com/taskforcesh/bullmq/commit/1b95185e8f4a4349037b59e61455bdec79792644))


### Features

* **job:** add option for removing children in remove method (python) ([#2064](https://github.com/taskforcesh/bullmq/issues/2064)) ([841dc87](https://github.com/taskforcesh/bullmq/commit/841dc87a689897df81438ad1f43e45a4da77c388))
Expand All @@ -63,7 +53,6 @@
### Features

* **job:** add removeDependencyOnFailure option ([#1953](https://github.com/taskforcesh/bullmq/issues/1953)) ([ffd49e2](https://github.com/taskforcesh/bullmq/commit/ffd49e289c57252487200d47b92193228ae7451f))
* **python:** add remove method in queue ([#2066](https://github.com/taskforcesh/bullmq/issues/2066)) ([808ee72](https://github.com/taskforcesh/bullmq/commit/808ee7231c75d4d826881f25e346f01b2fd2dc23))

# [4.3.0](https://github.com/taskforcesh/bullmq/compare/v4.2.1...v4.3.0) (2023-07-14)

Expand Down
4 changes: 2 additions & 2 deletions docs/gitbook/python/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@

## v1.8.0 (2023-07-17)
### Fix
* **python:** Respect concurrency in worker (#2062) fixes #2063 ([`1b95185`](https://github.com/taskforcesh/bullmq/commit/1b95185e8f4a4349037b59e61455bdec79792644))
* **worker:** Respect concurrency (#2062) fixes #2063 ([`1b95185`](https://github.com/taskforcesh/bullmq/commit/1b95185e8f4a4349037b59e61455bdec79792644))

## v1.7.0 (2023-07-14)
### Feature
* **python:** Add remove method in queue ([#2066](https://github.com/taskforcesh/bullmq/issues/2066)) ([`808ee72`](https://github.com/taskforcesh/bullmq/commit/808ee7231c75d4d826881f25e346f01b2fd2dc23))
* **queue:** Add remove method ([#2066](https://github.com/taskforcesh/bullmq/issues/2066)) ([`808ee72`](https://github.com/taskforcesh/bullmq/commit/808ee7231c75d4d826881f25e346f01b2fd2dc23))
* **worker:** Add id as part of token ([#2061](https://github.com/taskforcesh/bullmq/issues/2061)) ([`e255356`](https://github.com/taskforcesh/bullmq/commit/e2553562271e1e4143a8fef616349bb30de4899d))

## v1.6.1 (2023-07-10)
Expand Down
8 changes: 5 additions & 3 deletions tests/test_flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,7 @@ describe('flows', () => {
const processingChildren = new Promise<void>(resolve => {
childrenProcessor = async (job: Job) => {
processedChildren++;
await delay(20);
await delay(25);
expect(processedChildren).to.be.equal(job.data.order);

if (processedChildren === 3) {
Expand All @@ -1321,7 +1321,7 @@ describe('flows', () => {
const processingGrandchildren = new Promise<void>(resolve => {
grandChildrenProcessor = async (job: Job) => {
processedGrandChildren++;
await delay(10);
await delay(25);
expect(processedGrandChildren).to.be.equal(job.data.order);

if (processedGrandChildren === 3) {
Expand Down Expand Up @@ -1365,7 +1365,7 @@ describe('flows', () => {
const grandChildrenWorker = new Worker(
grandChildrenQueueName,
grandChildrenProcessor,
{ connection },
{ autorun: false, connection },
);

await parentWorker.waitUntilReady();
Expand Down Expand Up @@ -1428,6 +1428,8 @@ describe('flows', () => {
expect(parentState).to.be.eql('waiting-children');
expect(children).to.have.length(3);

grandChildrenWorker.run();

await processingGrandchildren;

childrenWorker.run();
Expand Down

0 comments on commit 4ccb045

Please sign in to comment.