MCPcopy Create free account
hub / github.com/apache/thrift / parseThrift

Function parseThrift

lib/nodejs/examples/parse.js:37–46  ·  view source on GitHub ↗

This is a standalone deserialize/parse example if you just want to deserialize thrift decoupled from cassandra server 1. acquire thrift template specification files from who ever built it (eg: EXAMPLE.thrift) 2. Install thrift on local machine 3. generate thrift clients for nodejs usin

(thriftEncodedData, callback)

Source from the content-addressed store, hash-verified

35 */
36
37function parseThrift(thriftEncodedData, callback) {
38 var thrift = require("thrift");
39 var transport = new thrift.TFramedTransport(thriftEncodedData);
40 var protocol = new thrift.TBinaryProtocol(transport);
41
42 var clientClass = require("../gen-nodejs/GENERATED").YOUR_CLASS_NAME;
43 var client = new clientClass();
44 client.read(protocol);
45 callback(null, client);
46}

Callers

nothing calls this directly

Calls 2

callbackFunction · 0.85
readMethod · 0.65

Tested by

no test coverage detected