-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #120 from moleculerjs/configurable-psql
v 0.2.0
- Loading branch information
Showing
8 changed files
with
10,274 additions
and
10,136 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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<a name="0.2.0"></a> | ||
|
||
# [0.2.0] | ||
|
||
- Change mixin signature. | ||
**Old** | ||
|
||
```js | ||
const PsqlQueueService = require("moleculer-psql-queue"); | ||
broker.createService({ | ||
name: "pub", | ||
mixins: [ | ||
PsqlQueueService( | ||
"postgres://postgres:postgres@localhost:5444/task_queue" | ||
// {}, // Optional worker configs. More info: https://github.com/graphile/worker#runneroptions | ||
// {}, // Optional producer configs: More info: https://github.com/graphile/worker#workerutilsoptions | ||
), | ||
], | ||
}); | ||
``` | ||
|
||
**New** | ||
|
||
```js | ||
const PsqlQueueService = require("moleculer-psql-queue"); | ||
broker.createService({ | ||
name: "pub", | ||
mixins: [ | ||
PsqlQueueService( | ||
"postgres://postgres:postgres@localhost:5444/task_queue", | ||
// Default opts | ||
{ | ||
// Name of the property in service schema. | ||
schemaProperty: "queues", | ||
// Name of the method in Service to create jobs | ||
createJobMethodName: "createJob", | ||
// Name of the property in Service to produce jobs | ||
producerPropertyName: "$producer", | ||
// Name of the property in Service to consume jobs | ||
consumerPropertyName: "$consumer", | ||
// Name of the internal queue that's used to store the job handlers | ||
internalQueueName: "$queue", | ||
// Name of the property in Service settings to register job event handlers | ||
jobEventHandlersSettingsProperty: "jobEventHandlers", | ||
// Optional producer configs: More info: https://github.com/graphile/worker#workerutilsoptions | ||
producerOpts: {}, | ||
// Optional worker configs. More info: https://github.com/graphile/worker#runneroptions | ||
queueOpts: { | ||
concurrency: 5, | ||
// Install signal handlers for graceful shutdown on SIGINT, SIGTERM, etc | ||
noHandleSignals: false, | ||
pollInterval: 1000, | ||
}, | ||
} | ||
), | ||
], | ||
}); | ||
``` | ||
|
||
- Rename internal methods to avoid with other libs (e.g. `moleculer-bull`). | ||
|
||
- `initLogger` -> `initWorkerLogger` | ||
- `tryConnect` -> `tryConnectWorker` | ||
- `connect` -> `connectWorker` | ||
|
||
- Bump deps |
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
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
Oops, something went wrong.