Skip to content

Commit

Permalink
Add documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhanson committed Apr 1, 2014
1 parent c4812c8 commit 13d3826
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
15 changes: 15 additions & 0 deletions lib/crane-amqp/broker.js
Expand Up @@ -303,6 +303,21 @@ Broker.prototype.unsubscribe = function(queue, options, cb) {
});
}

/**
* Declare a queue.
*
* Examples:
*
* broker.declare('tasks/mail', function(err, queue) {
* if (err) { throw err; }
* ...
* });
*
* @param {String} queue
* @param {Object} options
* @param {Function} cb
* @api public
*/
Broker.prototype.declare = function(queue, options, cb) {
if (typeof options == 'function') {
cb = options;
Expand Down
11 changes: 9 additions & 2 deletions lib/crane-amqp/queue.js
Expand Up @@ -5,7 +5,7 @@ var debug = require('debug')('crane-amqp');


/**
* `Broker` constructor.
* `Queue` constructor.
*
* @api protected
*/
Expand All @@ -17,6 +17,13 @@ function Queue(queue, exchange) {
/**
* Bind queue to topic.
*
* Examples:
*
* queue.bind('notifications/email/*', function(err) {
* if (err) { throw err; }
* ...
* });
*
* @api public
*/
Queue.prototype.bind = function(topic, cb) {
Expand Down Expand Up @@ -48,6 +55,6 @@ Queue.prototype.bind = function(topic, cb) {


/**
* Expose `Broker`.
* Expose `Queue`.
*/
module.exports = Queue;

0 comments on commit 13d3826

Please sign in to comment.