MCPcopy
hub / github.com/parse-community/parse-server / Consumer

Class Consumer

src/Adapters/MessageQueue/EventEmitterMQ.js:28–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28class Consumer extends events.EventEmitter {
29 emitter: any;
30
31 constructor(emitter: any) {
32 super();
33 this.emitter = emitter;
34 }
35
36 subscribe(channel: string): void {
37 unsubscribe(channel);
38 const handler = message => {
39 this.emit('message', channel, message);
40 };
41 subscriptions.set(channel, handler);
42 this.emitter.on(channel, handler);
43 }
44
45 unsubscribe(channel: string): void {
46 unsubscribe(channel);
47 }
48}
49
50function createPublisher(): any {
51 return new Publisher(emitter);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected