You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -79,11 +84,37 @@ import { helloTask } from "./hello.task";
79
84
exportclassAppModule {}
80
85
```
81
86
82
-
## Create task
87
+
The module configuration is [`GraphileWorkerConfiguration`](./src/interfaces/module-config.interfaces.ts), which is a wrapper around Graphile's [`RunnerOptions`](https://github.com/graphile/worker/blob/7feecdde5692569f006d3379f4caee01c4482707/src/interfaces.ts#L716)
Then do not forget to register this class as provider in your module:
104
135
105
136
```ts
137
+
// src/app.module.ts
106
138
import { Module } from"@nestjs/common";
107
139
import { HelloTask } from"./hello.task";
108
140
// ...
@@ -119,9 +151,9 @@ import { HelloTask } from "./hello.task";
119
151
exportclassAppModule {}
120
152
```
121
153
122
-
## Create jobs
154
+
### 3. Create jobs
123
155
124
-
You may use `WorkerService`:
156
+
You can use [`WorkerService`](./src/services/worker.service.ts) which is a wrapper of [`graphile-worker`](graphile-worker)'s [`Runner`](https://worker.graphile.org/docs/library/run#runner) instance. [`WorkerService`](./src/services/worker.service.ts) let you add job easily.
Add [`WorkerService.run`](https://github.com/madeindjs/nestjs-graphile-worker/blob/7ed5a99dcd28a11259031e0e738b0cf5a4050904/src/services/worker.service.ts#L31-L42) in `main.ts` file:
0 commit comments