Skip to content

Connection pooling for erserve, the Erlang/Rserve interface.

License

Notifications You must be signed in to change notification settings

del/erserve_pool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

erserve_pool - Connection pooling for erserve

Introduction

erserve

erserve is an Erlang application that implements the communication with Rserve, making it possible to make calls to R from Erlang, and to receive data back.

erserve_pool

erserve_pool provides a simple connection pool for erserve, including a fixed set of commands to be run upon opening a connection.

erserve_pool monitors the process which called get_connection and returns the allocated connection to the pool if that process dies. If a connection dies, a new one is created and added to the pool in its place.

Example

% Start a pool NConnections = 10, Opts = [ {host, "localhost"} , {port, 6311} , {init_commands, ["library(plyr)"]} ], erserve_pool:start_pool(my_pool, NConnections, Opts),

% Get a connection {ok, Conn} = erserve_pool:get_connection(my_pool),

% Run some erserve commands erserve:eval_void(Conn, "c(1,2,3)"),

% Return the connection to the pool erserve_pool:return_connection(my_pool, Conn).

About

Connection pooling for erserve, the Erlang/Rserve interface.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages