Comparing version 1.0.19 to 1.0.20
@@ -176,2 +176,25 @@ /* | ||
function set_reconnect(reconnect, connection) { | ||
if (typeof reconnect === 'boolean') { | ||
if (reconnect) { | ||
var initial = connection.get_option('initial_reconnect_delay', 100); | ||
var max = connection.get_option('max_reconnect_delay', 60000); | ||
connection.options.reconnect = restrict( | ||
connection.get_option('reconnect_limit'), | ||
backoff(initial, max) | ||
); | ||
} else { | ||
connection.options.reconnect = false; | ||
} | ||
} else if (typeof reconnect === 'number') { | ||
var fixed = connection.options.reconnect; | ||
connection.options.reconnect = restrict( | ||
connection.get_option('reconnect_limit'), | ||
function() { | ||
return fixed; | ||
} | ||
); | ||
} | ||
} | ||
var conn_counter = 1; | ||
@@ -204,10 +227,3 @@ | ||
var reconnect = this.get_option('reconnect', true); | ||
if (typeof reconnect === 'boolean' && reconnect) { | ||
var initial = this.get_option('initial_reconnect_delay', 100); | ||
var max = this.get_option('max_reconnect_delay', 60000); | ||
this.options.reconnect = restrict(this.get_option('reconnect_limit'), backoff(initial, max)); | ||
} else if (typeof reconnect === 'number') { | ||
var fixed = this.options.reconnect; | ||
this.options.reconnect = restrict(this.get_option('reconnect_limit'), function () { return fixed; }); | ||
} | ||
set_reconnect(reconnect, this); | ||
this.registered = false; | ||
@@ -234,3 +250,4 @@ this.state = new EndpointState(); | ||
aliases.forEach((alias) => Object.defineProperty(this, alias, { get: remote_property_shortcut(alias) })); | ||
var self = this; | ||
aliases.forEach(function (alias) { Object.defineProperty(self, alias, { get: remote_property_shortcut(alias) }); }); | ||
Object.defineProperty(this, 'error', { get: function() { return this.remote.close ? this.remote.close.error : undefined; }}); | ||
@@ -306,2 +323,6 @@ }; | ||
Connection.prototype.set_reconnect = function (reconnect) { | ||
set_reconnect(reconnect, this); | ||
}; | ||
Connection.prototype._connect = function (details) { | ||
@@ -308,0 +329,0 @@ if (details.connect) { |
@@ -230,3 +230,4 @@ /* | ||
this.observers = new EventEmitter(); | ||
aliases.forEach((alias) => Object.defineProperty(this, alias, { get: remote_property_shortcut(alias) })); | ||
var self = this; | ||
aliases.forEach(function (alias) { Object.defineProperty(self, alias, { get: remote_property_shortcut(alias) }); }); | ||
Object.defineProperty(this, 'error', { get: function() { return this.remote.detach ? this.remote.detach.error : undefined; }}); | ||
@@ -233,0 +234,0 @@ }; |
@@ -398,6 +398,6 @@ /* | ||
types.wrap_string = function (s) { | ||
return Buffer.from(s).length > 255 ? types.Str32(s) : types.Str8(s); | ||
return Buffer.byteLength(s) > 255 ? types.Str32(s) : types.Str8(s); | ||
}; | ||
types.wrap_symbol = function (s) { | ||
return Buffer.from(s).length > 255 ? types.Sym32(s) : types.Sym8(s); | ||
return Buffer.byteLength(s) > 255 ? types.Sym32(s) : types.Sym8(s); | ||
}; | ||
@@ -404,0 +404,0 @@ types.wrap_list = function(l) { |
{ | ||
"name": "rhea", | ||
"version": "1.0.19", | ||
"version": "1.0.20", | ||
"description": "reactive AMQP 1.0 library", | ||
@@ -5,0 +5,0 @@ "homepage": "http://github.com/amqp/rhea", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
891348
14138