Skip to content

Commit 0347879

Browse files
authored
Update README.md to clarify the examples
1 parent 9798269 commit 0347879

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import PeanarApp from 'peanar';
3838
3939
const app = new PeanarApp({
4040
connection: {
41-
hostname: 'localhost',
41+
host: 'localhost',
4242
username: 'guest',
4343
password: 'guest',
4444
},
@@ -90,11 +90,11 @@ On the web server:
9090
```ts
9191
import PeanarApp from 'peanar';
9292
93-
const app = new PeanarApp({
93+
const peanar = new PeanarApp({
9494
connection: 'amqp://localhost',
9595
});
9696
97-
const sendEmail = app.job({
97+
const sendEmail = peanar.job({
9898
name: 'sendEmail',
9999
queue: 'mailer',
100100
// importantly, the publisher doesn't need to know about the handler implementation, only its signature
@@ -121,11 +121,11 @@ On the worker:
121121
import PeanarApp from 'peanar';
122122
import { EmailService } from './email-service';
123123
124-
const app = new PeanarApp({
124+
const peanar = new PeanarApp({
125125
connection: 'amqp://localhost',
126126
});
127127
128-
const sendEmail = app.job({
128+
const sendEmail = peanar.job({
129129
name: 'sendEmail',
130130
queue: 'mailer',
131131
@@ -138,10 +138,10 @@ const sendEmail = app.job({
138138
});
139139
140140
// create AMQP resources
141-
await app.declareAmqResources();
141+
await peanar.declareAmqResources();
142142
143143
// start workers
144-
await app.worker({
144+
await peanar.worker({
145145
queues: ['mailer'],
146146
concurrency: 3, // 3 consumers on the queue, will process 3 jobs in parallel
147147
prefetch: 1,

0 commit comments

Comments
 (0)