clever / thrift-pool Goto Github PK
View Code? Open in Web Editor NEWA module that wraps thrift interfaces in connection pooling logic to make them more resilient.
License: Apache License 2.0
A module that wraps thrift interfaces in connection pooling logic to make them more resilient.
License: Apache License 2.0
I basically tried to test the library with no thrift server running. constructor option is
{
host: "127.0.0.1",
port: 8000,
max_connections: 1,
min_connections: 0,
idle_timeout: 1 * 1000,
ssl: false
}
then i got an error of
"TypeError: cb is not a function"
at /node_modules/node-thrift-pool/index.js:143:18
but i'd expect the same error as in debug message:
thrift-pool in error callback +0ms
thrift-pool Connection acquired +2ms
thrift-pool { err: { Error: connect ECONNREFUSED 127.0.0.1:8000 at Object.exports._errnoException (util.js:1007:11) at exports._exceptionWithHostPort (util.js:1030:20) at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1080:14) code: 'ECONNREFUSED', errno: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 8000 } } +1ms
thrift-pool in close callback +8ms
is this error message expected?
Hi, how can I check if the thrift connection is open/valid before I use the client method? Is there a way to know if the connection was established correctly when I'm creating a thrift client?
If I just do this:
var thrift_client = thriftPool(thrift, Service, {host: "localhost", port: 9090});
How can i guarantee that the connection is working before i call a method on the client?
Add the ability to create multiplexed clients.
I am getting this error immediately after connection is created.
Here is my code:
var options = {
transport: thrift.TBufferedTransport,
protocol: thrift.TBinaryProtocol,
path: "/data",
timeout:10000
};
var thrift_client = thriftPool(thrift, thClientService, {host: "hostname", port: 80 }, options);
thrift_client.getData(id, function(err, data){
if(errr){
console.log(error);
}
console.log(data);
});
When I try to call oneway function, I get "Connection timeout" error after timeout. But actually the message reaches my server. This isn't what I have expected, because the callback should have been called immediately without any error.
Just an idea, it would be great to be able to specify multiple hosts, so we could pool connections across multiple hosts :)
the origin way the err emitted on a connection
I have dynamic backend thrift services, those micro services come and go periodically, they are very dynamic. The problem is that when a service is removed, how can I close the thrift connection pool immediately?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.