Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any intentions to enable pooling? #31

Open
ezsper opened this issue Oct 6, 2016 · 2 comments
Open

Any intentions to enable pooling? #31

ezsper opened this issue Oct 6, 2016 · 2 comments

Comments

@ezsper
Copy link

ezsper commented Oct 6, 2016

As I could see, the CassanKnex is entirely single client. Would be best if the cassandra variable wasn't private, so the user could manipulate to make connections pooling of the resource.

@UnbounDev
Copy link
Contributor

Hey @ezsper, the initial constructor connection field is a straight pass through to the underlying datastax driver, so you should be able to enable pooling like so

var cassandra = require('cassandra-driver');
var distance = cassandra.types.distance;

var cassanKnex = require("cassanknex")({
  connection: {
    contactPoints: ['1.2.3.4'],
    pooling: {
       coreConnectionsPerHost: {
         [distance.local] = 2,
         [distance.remote] = 1
       } 
    }
  }
});

@ezsper
Copy link
Author

ezsper commented Oct 11, 2016

You're right! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants