Forum: Building VoltDB Applications

Post: voltjs: how to disconnect

voltjs: how to disconnect
theschmitzer
Feb 11, 2013
Using node module voltjs, what is the proper way to disconnect?

Is a disconnection automatic when the connect callback completes, or should the app make a call to force disconnection?

Thanks

jeff
jpiekos
Feb 12, 2013
Hi Jeff,

I'm looking through the driver code and it looks like there is no explicit way to close the connection through the VoltClient API (though there is a close() on the connection). I'll log a ticket, thanks!

John
theschmitzer
Feb 12, 2013
Thanks John

It becomes difficult/impossible to write a unit test without being able to disconnect and end the program.
jpiekos
Feb 12, 2013
Hi Jeff,

The node.js client source is available in github - one option is to add to the api to get around this (connection.js has a close method that needs to be invoked from client.js). If you decide update the driver, we'd love to get the contribution back (our contributor license agreement can be found here: http://voltdb.com/contributor-license-agreement.php)

John
theschmitzer
Feb 12, 2013
What I see in github https://github.com/jacwright/voltjs does not match what I got from npm install voltjs

npm givers me this in the lib dir

voltjs$ ls lib
client.js connection.js ctype.js parser.js voltconstants.js
configuration.js ctio.js message.js query.js

Github has a different list of sources, and none of the examples.
jpiekos
Feb 12, 2013
Hi Jeff,

I think the voltjs NPM may be out of date with regards to github (and voltdb.com/downloads). Would you have any interest in updating and/or maintaining the Node.js Volt client with NPM?

John
theschmitzer
Feb 13, 2013
Perhaps, we are in discussion here at OCI about this.