Thrift Client Factory
A factory for creating ready-made client using the default configuration thrift clients for nodejs.
Getting Started
In order to run tests for this package, some external dependencies need to be installed.
- Install grunt.
$ npm install -g grunt-cli
- Install thrift. Most package managers (brew, chocolately, etc.) have a package for thrift.
- Install npm modules
$ cd {repository-directory}$ npm install
Running tests
$ grunt test
Usage
Create a Client
// Required node modulesvar factory = ; // Required filesvar MyService = ; var hostname = "localhost"; // Arbitrary hostvar hostport = 9160; // Arbitrary port { console;} var MyClient = factory;
Destroy a Client
In a persistent process, if the client/connection is not persisted, then use:
// Thrift creates a reference between the connection object and the client.// When finished with the client and connection, use:factory;