iron-promise
v0.1.1
Published
Promise/A+ supported IronMQ API client library for Node.js (wrapper for the official client)
Downloads
6
Maintainers
Readme
iron-promise
iron-promise
is a Promise/A+ supported wrapper of iron_mq_node, the official API client library of IronMQ for Node.js.
This wrapper library made the following changes:
- Supports Promise/A+ pattern (instead of callback)
- Renamed
underscore_case
tocamelCase
for function and variable names - Cleaned up API by converting ugly pythonic names to explicit JS-friendly names (ex:
del_msg_push_status
todeleteMessagePushStatus
)
Installation
$ npm install iron-promise
Usage
var queue = new (require('iron-promise'))({
token: '<token>',
projectId: '<project-id>',
// queue: 'default'
});
queue
.post(['Hello', 'World'])
.then(queue.info.bind(queue))
.done(function (result) {
console.log(result);
});
API
- Please refer to the documentation of iron_mq_node. (all API functions are 1-to-1 mapped)
.queue(queueName)
.queues(options)
.info()
.clear()
.update(options)
.addSubscribers(subscribers)
.removeSubscribers(subscribers)
.deleteQueue()
.post(messages)
.get(options)
.peek(options)
.delete(messageId)
.getMessage(messageId)
.touchMessage(messageId)
.releaseMessage(messageId, options)
.getMessagePushStatus(messageId)
.deleteMessagePushStatus(messageId, subscriberId)
Credits
See the contributors.