co-thrift
Co wrapper for thrift clients.
The wrapper just searches the prototype for every method, which does not start
with send_
or recv_
and replaces it with a version you can yield. This may
not be save, but it works for my purpose.
WARNING: The client prototype gets changed. This could be a problem.
Installation
$ npm install co-thrift
Example
Just do as you normally do in thrift, but pass the Client object to the wrapper.
Line:
var client = thrift;// ... client;
Full Example:
var wrapper = thrift = StreamingService = ; var transport = thriftTFramedTransport;var protocol = thriftTBinaryProtocol; var connection = thrift; connection; var client = thrift; moduleexports { client;}
License
ISC