Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mutual

Package Overview
Dependencies
Maintainers
3
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mutual - npm Package Compare versions

Comparing version 0.4.14 to 0.4.15

278

lib/durable-channel.js

@@ -75,15 +75,13 @@ // Generated by CoffeeScript 1.7.1

} else {
return this.events.source((function(_this) {
return function(events) {
return _this.events.serially(function(go) {
go(function() {
return _this.adapter.collection("" + _this.name + ".messages");
});
return go(function(store) {
_this.store = store;
return events.emit("success", _this.store);
});
})();
return this.events.serially((function(_this) {
return function(go) {
go(function() {
return _this.adapter.collection("" + _this.name + ".messages");
});
return go(function(store) {
_this.store = store;
return _this.store;
});
};
})(this));
})(this))();
}

@@ -96,15 +94,13 @@ };

} else {
return this.events.source((function(_this) {
return function(events) {
return _this.events.serially(function(go) {
go(function() {
return _this.adapter.collection("" + name + ".messages");
});
return go(function(store) {
_this.destinationStores[name] = store;
return events.emit("success", store);
});
})();
return this.events.serially((function(_this) {
return function(go) {
go(function() {
return _this.adapter.collection("" + name + ".messages");
});
return go(function(store) {
_this.destinationStores[name] = store;
return store;
});
};
})(this));
})(this))();
}

@@ -189,71 +185,62 @@ };

DurableChannel.prototype.expireMessage = function(channel, id) {
return this.events.source((function(_this) {
return function(events) {
var message, store;
store = null;
message = null;
return _this.events.serially(function(go) {
go(function() {
return _this.getDestinationStore(channel);
});
go(function(_store) {
store = _store;
return store.get(id);
});
go(function(_message) {
message = _message;
if (message != null) {
return store["delete"](id);
}
});
go(function() {
return _this.clearMessageTimeout(_this.name, channel, id);
});
return go(function() {
if (message != null) {
_this.fire({
event: "timeout",
content: {
content: message.content,
requestId: message.requestId
}
});
}
return events.emit("success");
});
})();
var message, store;
store = null;
message = null;
return this.events.serially((function(_this) {
return function(go) {
go(function() {
return _this.getDestinationStore(channel);
});
go(function(_store) {
store = _store;
return store.get(id);
});
go(function(_message) {
message = _message;
if (message != null) {
return store["delete"](id);
}
});
go(function() {
return _this.clearMessageTimeout(_this.name, channel, id);
});
return go(function() {
if (message != null) {
return _this.fire({
event: "timeout",
content: {
content: message.content,
requestId: message.requestId
}
});
}
});
};
})(this));
})(this))();
};
DurableChannel.prototype.send = function(_arg) {
var content, timeout, to;
var content, message, timeout, to;
content = _arg.content, to = _arg.to, timeout = _arg.timeout;
return this.events.source((function(_this) {
return function(events) {
var message;
message = _this["package"]({
content: content,
to: to,
timeout: timeout
message = this["package"]({
content: content,
to: to,
timeout: timeout
});
return this.events.serially((function(_this) {
return function(go) {
go(function() {
return _this.getDestinationStore(to);
});
return _this.events.serially(function(go) {
go(function() {
return _this.getDestinationStore(to);
});
go(function(store) {
return store.put(message.id, message);
});
go(function() {
return _this.setMessageTimeout(_this.name, to, message.id, message.timeout);
});
go(function() {
return _this.getDestinationQueue(to).emit("message", message.id);
});
return go(function() {
return events.emit("success");
});
})();
go(function(store) {
return store.put(message.id, message);
});
go(function() {
return _this.setMessageTimeout(_this.name, to, message.id, message.timeout);
});
return go(function() {
return _this.getDestinationQueue(to).emit("message", message.id);
});
};
})(this));
})(this))();
};

@@ -264,65 +251,55 @@

message = _arg.message, response = _arg.response, timeout = _arg.timeout;
return this.events.source((function(_this) {
return function(events) {
return _this.events.serially(function(go) {
go(function() {
return _this.getStore();
});
go(function(store) {
return store.get(message.requestId);
});
return go(function(request) {
if (request == null) {
return;
}
return _this.events.serially(function(go) {
go(function() {
message = _this["package"]({
content: response,
to: request.from,
requestId: message.requestId,
timeout: timeout
});
return _this.getDestinationStore(request.from);
return this.events.serially((function(_this) {
return function(go) {
go(function() {
return _this.getStore();
});
go(function(store) {
return store.get(message.requestId);
});
return go(function(request) {
if (request == null) {
return;
}
return _this.events.serially(function(go) {
go(function() {
message = _this["package"]({
content: response,
to: request.from,
requestId: message.requestId,
timeout: timeout
});
go(function(store) {
return store.put(message.id, message);
});
go(function() {
return _this.setMessageTimeout(_this.name, request.from, message.id, message.timeout);
});
go(function() {
return _this.getDestinationQueue(request.from).emit("message", message.id);
});
return go(function() {
return events.emit("success");
});
})();
});
})();
return _this.getDestinationStore(request.from);
});
go(function(store) {
return store.put(message.id, message);
});
go(function() {
return _this.setMessageTimeout(_this.name, request.from, message.id, message.timeout);
});
return go(function() {
return _this.getDestinationQueue(request.from).emit("message", message.id);
});
})();
});
};
})(this));
})(this))();
};
DurableChannel.prototype.close = function(message) {
return this.events.source((function(_this) {
return function(events) {
var request;
request = null;
return _this.events.serially(function(go) {
go(function() {
return _this.getStore();
});
go(function(store) {
return store["delete"](message.responseId);
});
go(function() {
return _this.clearMessageTimeout(message.to, message.from, message.responseId);
});
return go(function() {
return events.emit("success");
});
})();
var request;
request = null;
return this.events.serially((function(_this) {
return function(go) {
go(function() {
return _this.getStore();
});
go(function(store) {
return store["delete"](message.responseId);
});
return go(function() {
return _this.clearMessageTimeout(message.to, message.from, message.responseId);
});
};
})(this));
})(this))();
};

@@ -343,3 +320,3 @@

});
return go(function(message) {
go(function(message) {
if (message == null) {

@@ -365,3 +342,3 @@ return;

return go(function() {
var _message, _ref, _ref1;
var _message;
_message = {

@@ -376,12 +353,15 @@ content: message.content

}
_this.fire({
return _this.fire({
event: "message",
content: _message
});
if (((_ref = _this.channels["message"]) != null ? (_ref1 = _ref.handlers) != null ? _ref1.length : void 0 : void 0) > 0) {
return _this.queue.once("message", messageHandler);
}
});
})();
});
return go(function() {
var _ref, _ref1;
if (((_ref = _this.channels["message"]) != null ? (_ref1 = _ref.handlers) != null ? _ref1.length : void 0 : void 0) > 0) {
return _this.queue.once("message", messageHandler);
}
});
})();

@@ -388,0 +368,0 @@ };

{
"name": "mutual",
"version": "0.4.14",
"version": "0.4.15",
"description": "Scala-inspired Actors that use Redis as a message transport",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc