Skip to content

Pool of pools of erlcql connections to separate cassandra cluster nodes

Notifications You must be signed in to change notification settings

loucash/erlcql_cluster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

erlcql_cluster

Pool of pools of erlcql connections to separate cassandra cluster nodes

How to build it

make deps compile

Tutorial

Start an application:

1> erlcql_cluster:start().
{ok,[snappy,lz4,erlcql,poolboy,erlcql_poolboy,
     erlcql_cluster]}

Create new pool test for cluster with nodes.

2> erlcql_cluster:new(test, [{nodes, [{"localhost", 9160}]},
                                      {pool_size, 1},
                                      {pool_overflow, 1},
                                      {use, "kairosdb"},
                                      {prepare, []}]).
ok

Checkout a resource and get erlcql client:

3> {ok, {Pool, Worker}} = erlcql_cluster:checkout(test).
{ok,{testlocalhost9160,<0.59.0>}}

4> erlcql_cluster_worker:get_client(Worker).
<0.60.0>

Checkin resource:

5> erlcql_cluster:checkin({Pool, Worker}).
ok

About

Pool of pools of erlcql connections to separate cassandra cluster nodes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published