opnotiq

0.0.12 • Public • Published

opnotiq

NPM version Build Status

opnotiq is a component to handle actions against operations and notifications queues, a simple pattern we use for decoupling work load from API requests, for accepting operations via non-api calls (i.e through a GCM upstream message) and notify when it's done.

Usage

  var queues = require('queues');
 
  var options = {
    token: 'xxxxxxxx'
    project_id: 'xxxxxxxx'
  }
 
  // init queue provider
  var provider = queues.iron(options);
 
  // init optoniq
  var opnotiq = require('opnotiq')(provider);
 
  opnotiq.on('notification', function(msg) {
    // handle notification
  });
 
 
  opnotiq.postOperation('update-task', {
    // op specific data
  }, function(){
    // callback
  });
 
 
  opnotiq.postNotification('attach-project', 9349, {
    // notification specific data
  }, function(){
    // callback
  });

Package Sidebar

Install

npm i opnotiq

Weekly Downloads

1

Version

0.0.12

License

MIT

Last publish

Collaborators

  • vcalvello