Skip to content

Commit

Permalink
core: support queue_length for subscribing.
Browse files Browse the repository at this point in the history
The previous patch of using the queue_size was wrong,
since the defaults are quite different (100 vs 0).

Signed-off-by: Peter Soetens <peter@thesourceworks.com>
  • Loading branch information
Peter Soetens committed Mar 6, 2015
1 parent 08b2231 commit c397214
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/core/Topic.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ var Message = require('./Message');
* * name - the topic name, like /cmd_vel
* * messageType - the message type, like 'std_msgs/String'
* * compression - the type of compression to use, like 'png'
* * throttle_rate - the rate at which to throttle the topics
* * throttle_rate - the rate (in ms in between messages) at which to throttle the topics
* * queue_size - the queue created at bridge side for re-publishing webtopics (defaults to 100)
* * latch - latch the topic when publishing
* * queue_length - the queue length at bridge side used when subscribing (defaults to 0, no queueing).
*/
function Topic(options) {
options = options || {};
Expand All @@ -30,6 +33,7 @@ function Topic(options) {
this.throttle_rate = options.throttle_rate || 0;
this.latch = options.latch || false;
this.queue_size = options.queue_size || 100;
this.queue_length = options.queue_length || 0;

// Check for valid compression types
if (this.compression && this.compression !== 'png' &&
Expand Down Expand Up @@ -73,7 +77,7 @@ Topic.prototype.subscribe = function(callback) {
topic: this.name,
compression: this.compression,
throttle_rate: this.throttle_rate,
queue_length: this.queue_size
queue_length: this.queue_length
});
};

Expand Down

0 comments on commit c397214

Please sign in to comment.