Skip to content

Latest commit

 

History

History
46 lines (33 loc) · 927 Bytes

README.md

File metadata and controls

46 lines (33 loc) · 927 Bytes

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