TCP client for Callosum: a self-balancing distributed services protocol
Stability: 1 - Experimental
TCP Client for Callosum: a self-balancing distributed services protocol.
var CallosumClient = require'callosum-client-tcp';var callosumClient = MAX_SLOTS: 100;callosumClienton'error'console.logerror;;// add a connection to the connection pool// client will either hang on to the connection or close it if it is not neededcallosumClientnewConnectionslot socket;var socket = callosumClientgetConnection;// socket is either a connection that is available or undefinedcallosumClientreturnConnectionsocket;// return a previously leased connection to the client pool
TCP Client for Callosum: a self-balancing distributed services protocol. It servers as a connection pool.
Open available connections are maintained internally via two heap data structures. The min heap data structure is maintained in order to provide a connection from the pool with the lowest slot value. The max heap data structure is maintained in order to enable rapid checking and replacing of a connection with a high slot value if a new connection with a lower slot value becomes available.