Comparing version 1.1.7 to 1.1.8
@@ -47,3 +47,4 @@ "use strict"; | ||
options['service'] = this.service; | ||
options = this.filter(options); | ||
options['transport'] = this.config.options['transport']; | ||
options = this.filterInvalidValue(options); | ||
var taskHandler = function (order, max) { | ||
@@ -114,3 +115,3 @@ var record = { | ||
}; | ||
Client.prototype.filter = function (mapA) { | ||
Client.prototype.filterInvalidValue = function (mapA) { | ||
var mapB = {}; | ||
@@ -117,0 +118,0 @@ Object.keys(mapA).filter(function (key) { |
@@ -8,2 +8,3 @@ "use strict"; | ||
this.timeout = options['timeout']; | ||
this.transport = options['transport']; | ||
this.addr = addr; | ||
@@ -13,3 +14,8 @@ } | ||
var transport, protocol; | ||
transport = thrift.TBufferedTransport; | ||
if (this.transport && this.transport === 'Framed') { | ||
transport = thrift.TFramedTransport; | ||
} | ||
else { | ||
transport = thrift.TBufferedTransport; | ||
} | ||
protocol = thrift.TBinaryProtocol; | ||
@@ -16,0 +22,0 @@ return thrift.createConnection(this.addr.getHost(), this.addr.getPort(), { |
{ | ||
"name": "kitejs", | ||
"version": "1.1.7", | ||
"version": "1.1.8", | ||
"description": "the rpc framework Kite for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -62,4 +62,5 @@ /** | ||
options['service'] = this.service; | ||
options['transport'] = this.config.options['transport']; | ||
options = this.filter(options); | ||
options = this.filterInvalidValue(options); | ||
@@ -148,3 +149,3 @@ let taskHandler = function (order, max) | ||
private filter(mapA) { | ||
private filterInvalidValue(mapA) { | ||
let mapB = {}; | ||
@@ -195,2 +196,2 @@ Object.keys(mapA).filter(function (key) { | ||
} | ||
} | ||
} |
@@ -22,2 +22,7 @@ /** | ||
protocol: string; | ||
/** | ||
* transport ( Framed | Buffered ) | ||
*/ | ||
transport: string; | ||
searchHostType: string = 'LOCAL'; // or 'CONSUL' | ||
@@ -24,0 +29,0 @@ /** |
@@ -13,2 +13,3 @@ /** | ||
timeout: number; | ||
transport: string; | ||
@@ -18,2 +19,3 @@ public constructor(addr: Address, options?: Map<any>) { | ||
this.timeout = options['timeout']; | ||
this.transport = options['transport'] | ||
this.addr = addr; | ||
@@ -25,5 +27,10 @@ } | ||
transport = thrift.TBufferedTransport; | ||
protocol = thrift.TBinaryProtocol; | ||
if (this.transport && this.transport === 'Framed') { | ||
transport = thrift.TFramedTransport; | ||
} else { | ||
transport = thrift.TBufferedTransport; | ||
} | ||
protocol = thrift.TBinaryProtocol; | ||
return thrift.createConnection(this.addr.getHost(), this.addr.getPort(), { | ||
@@ -30,0 +37,0 @@ transport: transport, |
82717
42
1632