Skip to content

post method returns multiple types based on number of messages queued #51

Description

@paulcullin

The queue.post() method returns message id's to its callback after success. However, the format of the response object is not consistent. If one message was queued, the response object is a string with the message id. If more than one message was successfully queued, it returns an array of string message id's. This forces consuming clients to implement logic to properly access the message id's returned by the post.

For example:

var iron_mq = require('iron_mq');
var queue = new iron_mq.Client([credentials]);

queue.post({foo:bar}, function(err, res) {
    var messageIds = res; // will be a string of one message id
});

queue.post([{foo:bar},{baz:biz}], function(err, res) {
    var messageIds = res; // will be an array of message ids
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions