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

Method constructor

src/Push/PushWorker.js:27–41  ·  view source on GitHub ↗
(pushAdapter: PushAdapter, subscriberConfig: any = {})

Source from the content-addressed store, hash-verified

25 channel: string;
26
27 constructor(pushAdapter: PushAdapter, subscriberConfig: any = {}) {
28 AdaptableController.validateAdapter(pushAdapter, this, PushAdapter);
29 this.adapter = pushAdapter;
30
31 this.channel = subscriberConfig.channel || PushQueue.defaultPushChannel();
32 this.subscriber = ParseMessageQueue.createSubscriber(subscriberConfig);
33 if (this.subscriber) {
34 const subscriber = this.subscriber;
35 subscriber.subscribe(this.channel);
36 subscriber.on('message', (channel, messageStr) => {
37 const workItem = JSON.parse(messageStr);
38 this.run(workItem);
39 });
40 }
41 }
42
43 run({ body, query, pushStatus, applicationId, UTCOffset }: any): Promise<*> {
44 const config = Config.get(applicationId);

Callers

nothing calls this directly

Calls 5

runMethod · 0.95
defaultPushChannelMethod · 0.80
createSubscriberMethod · 0.80
subscribeMethod · 0.65
validateAdapterMethod · 0.45

Tested by

no test coverage detected