Comparing version 0.17.1 to 0.19.0
// Generated by LiveScript 1.5.0 | ||
var EventEmitter, HandlerManager, MessageSender, ref$, delegate, delegateEvent, ZmqListener, debug, ExoRelay; | ||
var EventEmitter, ip, HandlerManager, MessageSender, ref$, delegate, delegateEvent, ZmqListener, debug, ExoRelay; | ||
EventEmitter = require('events').EventEmitter; | ||
ip = require('ip'); | ||
HandlerManager = require('./message-handler/message-manager'); | ||
@@ -12,11 +13,16 @@ MessageSender = require('./message-sender/message-sender'); | ||
function ExoRelay(config){ | ||
var x$; | ||
var ref$, ref1$, ref2$, x$; | ||
this.config = config; | ||
this._sendRoutingConfig = bind$(this, '_sendRoutingConfig', prototype); | ||
this._onIncomingMessage = bind$(this, '_onIncomingMessage', prototype); | ||
this.send = bind$(this, 'send', prototype); | ||
(config != null && config.exocomPort) || (function(){ | ||
throw new Error('exocomPort not provided'); | ||
((ref$ = this.config) != null && ref$.exocomHost) || (function(){ | ||
throw new Error('ExoCom host not provided to Exorelay'); | ||
}()); | ||
(config != null && config.serviceName) || (function(){ | ||
throw new Error('serviceName not provided'); | ||
((ref1$ = this.config) != null && ref1$.exocomPort) || (function(){ | ||
throw new Error('ExoCom port not provided to Exorelay'); | ||
}()); | ||
((ref2$ = this.config) != null && ref2$.serviceName) || (function(){ | ||
throw new Error('Service name not provided to Exorelay'); | ||
}()); | ||
this.messageHandler = new HandlerManager(); | ||
@@ -26,2 +32,3 @@ this.messageSender = new MessageSender(config); | ||
x$.on('message', this._onIncomingMessage); | ||
x$.on('online', this._sendRoutingConfig); | ||
delegate('closePort', { | ||
@@ -43,3 +50,3 @@ from: this, | ||
}); | ||
delegateEvent('status', 'online', 'offline', { | ||
delegateEvent('status', 'offline', { | ||
from: this.zmqListener, | ||
@@ -66,5 +73,2 @@ to: this | ||
} | ||
if (!requestData.id) { | ||
return 'missing message id'; | ||
} | ||
return this.messageHandler.handleRequest(requestData, { | ||
@@ -75,2 +79,11 @@ reply: this.messageSender.replyMethodFor(requestData.id), | ||
}; | ||
ExoRelay.prototype._sendRoutingConfig = function(){ | ||
this.send('exorelay.register', { | ||
name: this.config.serviceName, | ||
internalNamespace: this.config.internalNamespace, | ||
host: ip.address(), | ||
port: this.zmqListener.port | ||
}); | ||
return this.emit('online', this.zmqListener.port); | ||
}; | ||
return ExoRelay; | ||
@@ -77,0 +90,0 @@ }(EventEmitter)); |
@@ -10,2 +10,3 @@ // Generated by LiveScript 1.5.0 | ||
x$ = this.messageSender = new MessageSender({ | ||
exocomHost: 'localhost', | ||
exocomPort: 4100, | ||
@@ -12,0 +13,0 @@ serviceName: 'test' |
@@ -14,9 +14,6 @@ // Generated by LiveScript 1.5.0 | ||
? arg$ | ||
: {}, this.serviceName = ref$.serviceName, this.exocomPort = ref$.exocomPort; | ||
: {}, this.exocomHost = ref$.exocomHost, this.serviceName = ref$.serviceName, this.exocomPort = ref$.exocomPort; | ||
this.exocomPort = +this.exocomPort; | ||
if (!this.exocomPort) { | ||
throw new Error('ExoCom port not provided'); | ||
} | ||
x$ = this.socket = zmq.socket('push'); | ||
x$.connect("tcp://localhost:" + this.exocomPort); | ||
x$.connect("tcp://" + this.exocomHost + ":" + this.exocomPort); | ||
this.lastSentId = null; | ||
@@ -23,0 +20,0 @@ } |
{ | ||
"name": "exorelay", | ||
"version": "0.17.1", | ||
"version": "0.19.0", | ||
"author": "Kevin Goslar", | ||
@@ -8,3 +8,4 @@ "dependencies": { | ||
"debug": "2.2.0", | ||
"lodash.isempty": "4.2.1", | ||
"ip": "1.1.3", | ||
"lodash.isempty": "4.4.0", | ||
"node-uuid": "1.4.7", | ||
@@ -17,17 +18,19 @@ "rails-delegate": "0.6.2", | ||
"chai": "3.5.0", | ||
"cucumber": "1.2.1", | ||
"cucumber": "1.3.1", | ||
"cucumber-snippets-livescript": "1.0.1", | ||
"dependency-lint": "4.0.2", | ||
"ejs": "2.4.2", | ||
"dependency-lint": "4.1.5", | ||
"ejs": "2.5.2", | ||
"exocom-mock": "0.8.1", | ||
"jsdiff-console": "2.2.1", | ||
"livescript": "1.5.0", | ||
"lodash.isequal": "4.2.0", | ||
"mocha": "2.5.3", | ||
"mocha-circleci-reporter": "0.0.1", | ||
"lodash.isequal": "4.4.0", | ||
"mocha": "3.1.2", | ||
"mocha-circleci-reporter": "0.0.2", | ||
"nitroglycerin": "1.1.2", | ||
"o-tools": "0.4.16", | ||
"o-tools-livescript": "1.1.2", | ||
"portfinder": "1.0.3", | ||
"sinon": "1.17.4", | ||
"o-tools": "0.7.0", | ||
"o-tools-livescript": "1.2.3", | ||
"portfinder": "1.0.8", | ||
"prelude-ls": "1.1.2", | ||
"sinon": "1.17.6", | ||
"tertestrial": "0.3.2", | ||
"wait": "0.1.0" | ||
@@ -34,0 +37,0 @@ }, |
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
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
464
19256
7
19
2
0
+ Addedip@1.1.3
+ Addedip@1.1.3(transitive)
+ Addedlodash.isempty@4.4.0(transitive)
- Removedlodash._root@3.0.1(transitive)
- Removedlodash.isempty@4.2.1(transitive)
- Removedlodash.keys@4.2.0(transitive)
Updatedlodash.isempty@4.4.0