Comparing version 0.4.19 to 0.4.20
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.3 | ||
// Generated by CoffeeScript 1.12.7 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var Channel; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.3 | ||
// Generated by CoffeeScript 1.12.7 | ||
(function() { | ||
@@ -116,13 +116,38 @@ var DurableChannel, EventChannel, Redis, RemoteQueue, Transport, randomKey, | ||
DurableChannel.prototype.setMessageTimeout = function(name, channel, id, timeout) { | ||
var client, serverTime; | ||
if ((channel != null) && (id != null) && (timeout != null)) { | ||
return this.events.source((function(_this) { | ||
return function(events) { | ||
return _this.transport._acquire(function(client) { | ||
return client.zadd([name + ".pending", Date.now() + timeout, channel + "::" + id], function(err, data) { | ||
_this.transport._release(client); | ||
return events.callback(err, data); | ||
client = null; | ||
serverTime = 0; | ||
return this.events.serially((function(_this) { | ||
return function(go) { | ||
go(function() { | ||
return _this.events.source(function(events) { | ||
return _this.transport._acquire(function(_client) { | ||
client = _client; | ||
return events.callback(); | ||
}); | ||
}); | ||
}); | ||
go(function() { | ||
return _this.events.source(function(events) { | ||
return client.time(function(err, data) { | ||
if (err != null) { | ||
_this.transport._release(client); | ||
} else { | ||
serverTime = data[0] * 1000; | ||
} | ||
return events.callback(err, data); | ||
}); | ||
}); | ||
}); | ||
return go(function() { | ||
return _this.events.source(function(events) { | ||
return client.zadd([name + ".pending", serverTime + timeout, channel + "::" + id], function(err, data) { | ||
_this.transport._release(client); | ||
return events.callback(err, data); | ||
}); | ||
}); | ||
}); | ||
}; | ||
})(this)); | ||
})(this))(); | ||
} | ||
@@ -166,12 +191,33 @@ }; | ||
return _this.events.serially(function(go) { | ||
var client, serverTime; | ||
client = null; | ||
serverTime = 0; | ||
go(function() { | ||
return _this.events.source(function(events) { | ||
return _this.transport._acquire(function(client) { | ||
return client.zrangebyscore([_this.name + ".pending", 0, Date.now()], function(err, data) { | ||
return _this.transport._acquire(function(_client) { | ||
client = _client; | ||
return events.callback(); | ||
}); | ||
}); | ||
}); | ||
go(function() { | ||
return _this.events.source(function(events) { | ||
return client.time(function(err, data) { | ||
if (err != null) { | ||
_this.transport._release(client); | ||
return events.callback(err, data); | ||
}); | ||
} else { | ||
serverTime = data[0] * 1000; | ||
} | ||
return events.callback(err, data); | ||
}); | ||
}); | ||
}); | ||
go(function() { | ||
return _this.events.source(function(events) { | ||
return client.zrangebyscore([_this.name + ".pending", 0, serverTime], function(err, data) { | ||
_this.transport._release(client); | ||
return events.callback(err, data); | ||
}); | ||
}); | ||
}); | ||
go(function(expiredMessages) { | ||
@@ -178,0 +224,0 @@ if (expiredMessages.length === 0) { |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.3 | ||
// Generated by CoffeeScript 1.12.7 | ||
(function() { | ||
@@ -176,4 +176,4 @@ var Attributes, Channel, EventChannel, PatternSet, include, merge, overload, ref, type, w, | ||
return fn(); | ||
} catch (_error) { | ||
error = _error; | ||
} catch (error1) { | ||
error = error1; | ||
return this.emit("error", error); | ||
@@ -220,4 +220,4 @@ } | ||
} | ||
} catch (_error) { | ||
error = _error; | ||
} catch (error1) { | ||
error = error1; | ||
return events.emit("error", error); | ||
@@ -302,4 +302,4 @@ } | ||
} | ||
} catch (_error) { | ||
_error = _error; | ||
} catch (error1) { | ||
_error = error1; | ||
return record_error(name, _error); | ||
@@ -306,0 +306,0 @@ } |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.3 | ||
// Generated by CoffeeScript 1.12.7 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var getter; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.3 | ||
// Generated by CoffeeScript 1.12.7 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var Pattern, PatternSet; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.3 | ||
// Generated by CoffeeScript 1.12.7 | ||
(function() { | ||
@@ -12,4 +12,4 @@ var Pattern, _match, _parse, memoize, | ||
return string.split("."); | ||
} catch (_error) { | ||
error = _error; | ||
} catch (error1) { | ||
error = error1; | ||
throw new Error(string + " is not a valid pattern"); | ||
@@ -16,0 +16,0 @@ } |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.3 | ||
// Generated by CoffeeScript 1.12.7 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var EventChannel, Promisifier, promise; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.3 | ||
// Generated by CoffeeScript 1.12.7 | ||
(function() { | ||
@@ -147,3 +147,3 @@ var EventChannel, Pool, RedisTransport, redis, ref, toError, type, | ||
}); | ||
} catch (_error) { | ||
} catch (error1) { | ||
return events.emit("error"); | ||
@@ -150,0 +150,0 @@ } |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.3 | ||
// Generated by CoffeeScript 1.12.7 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var EventChannel, RemoteChannel, |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.3 | ||
// Generated by CoffeeScript 1.12.7 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var RemoteChannel, RemoteQueue, |
{ | ||
"name": "mutual", | ||
"version": "0.4.19", | ||
"version": "0.4.20", | ||
"description": "Scala-inspired Actors that use Redis as a message transport", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
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
53678
20
1325