Comparing version 0.1.17 to 0.1.18
@@ -109,18 +109,13 @@ var net = require('net'); | ||
// start routing chain | ||
scan(messages) { | ||
messages.forEach(msg => { | ||
console.log('SCAN:'+util.inspect(msg)); | ||
this.chains.input(msg).catch(err => { | ||
console.log('routing error:'+err); | ||
}) | ||
}) | ||
} | ||
// enqueue messages | ||
*queue() { | ||
while(true) { | ||
var {messages} = yield; | ||
this.scan(messages); | ||
var {messages, chain} = yield; | ||
chain = this.chains[chain] ? chain : 'input'; | ||
messages.forEach(msg => { | ||
this.chains[chain] (msg).catch(err => { | ||
console.log('routing error:'+err); | ||
}) | ||
}) | ||
} | ||
@@ -127,0 +122,0 @@ } |
@@ -9,5 +9,6 @@ var path = require('path'); | ||
class Server { | ||
constructor(consumer, options, attrs) { | ||
constructor(consumer, options, attrs={}) { | ||
var socks = this.socks = []; | ||
this.attrs = attrs; | ||
this.attrs.chain = attrs.chain || 'input'; | ||
@@ -14,0 +15,0 @@ if(options.tls) { |
@@ -60,3 +60,3 @@ { | ||
"optionalDependencies": {}, | ||
"version": "0.1.17", | ||
"version": "0.1.18", | ||
"directories": { | ||
@@ -63,0 +63,0 @@ "lib": "lib" |
53530
612