How to use the cote.Subscriber function in cote

To help you get started, we’ve selected a few cote examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github erxes / erxes-api / src / pubsub.ts View on Github external
}
    }

    graphqlPubsub.publish(data.trigger, { [data.trigger]: data.payload });
  }

  if (action === 'activityLog') {
    ActivityLogs.createLogFromWidget(data.type, data.payload);
  }
};

const convertPubSubBuffer = (data: Buffer) => {
  return JSON.parse(data.toString());
};

const subscriber = new cote.Subscriber(
  { name: 'erxes-api' },
  {
    log: false,
    statusLogsEnabled: false,
  },
);

subscriber.on('widgetNotification', data => {
  publishMessage(JSON.parse(data));
});

export const graphqlPubsub = createPubsubInstance();

cote

A Node.js library for building zero-configuration microservices.

MIT
Latest version published 5 months ago

Package Health Score

61 / 100
Full package analysis