Skip to content

Commit 1403de1

Browse files
committed
Updated readme for local events
1 parent eadf572 commit 1403de1

1 file changed

Lines changed: 2 additions & 35 deletions

File tree

README.md

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,6 @@ PLG Works Queue exposes following 3 methods:
5757

5858
<br>
5959

60-
- `queueManagerInstance.subscribeEvent.local( topics, readCallback)`
61-
- <b>topics</b> [Array] (mandatory) - List of events to subscribe to.
62-
- <b>readCallback</b> [function] (mandatory) - Callback method will be invoked whenever there is a new notification.
63-
64-
<br>
65-
6660
- `queueManagerInstance.publishEvent.perform(params)`
6761
- <b>params</b> [object] (mandatory)
6862
- <b>topics</b> [Array] (optional) List of topic messages to publish.
@@ -187,34 +181,7 @@ const subscribeMultiple = async function() {
187181
subscribeMultiple();
188182
```
189183

190-
#### 3. Subscribe to local events published through EventEmitter:
191-
192-
```js
193-
// Config Strategy for PLG Works Queue.
194-
configStrategy = {
195-
"rabbitmq": {
196-
"username": "guest",
197-
"password": "guest",
198-
"host": "127.0.0.1",
199-
"port": "5672",
200-
"heartbeats": "30",
201-
"enableRabbitmq": 0
202-
}
203-
};
204-
205-
// Import the queue module.
206-
const QueueManager = require('@plgworks/queue');
207-
const subscribeLocal = async function() {
208-
let queueManagerInstance = await QueueManager.getInstance(configStrategy);
209-
queueManagerInstance.subscribeEvent.local(["event.PublicTestLocalEvent"],
210-
function(msgContent){
211-
console.log('Consumed message -> ', msgContent)
212-
});
213-
};
214-
subscribeLocal();
215-
```
216-
217-
#### 4. Publish Notifications:
184+
#### 3. Publish Notifications:
218185

219186
- All events are by default published using EventEmitter and if configured, through RabbitMQ as well.
220187

@@ -253,7 +220,7 @@ const publish = async function() {
253220
publish();
254221
```
255222

256-
#### 5. Pause and Restart queue consumption:
223+
#### 4. Pause and Restart queue consumption:
257224

258225
- We also support pause and start queue consumption. According to your logical condition, you can fire below events from your process to cancel or restart consumption respectively.
259226

0 commit comments

Comments
 (0)