{"name":"tchannel","version":"2.2.2","author":{"name":"mranney@uber.com"},"_id":"tchannel@2.2.2","maintainers":[{"name":"raynos","email":"raynos2@gmail.com"},{"name":"mjr","email":"mjr@ranney.com"},{"name":"jwolski","email":"jeff.wolski@gmail.com"},{"name":"uber","email":"opensource@uber.com"},{"name":"jcorbin","email":"jcorbin@wunjo.org"},{"name":"kriskowal","email":"kris.kowal@cixar.com"},{"name":"russfrank","email":"me@russfrank.us"},{"name":"juncaoli","email":"juncaoli@uber.com"}],"homepage":"https://github.com/uber/tchannel","bugs":{"url":"https://github.com/uber/tchannel/issues"},"dist":{"shasum":"0da92d7c131e889e9dece10469eb89819e3cf764","tarball":"http://registry-npm.ywwl.com/tchannel/download/tchannel-2.2.2.tgz","integrity":"sha512-1nkxPO9M6bLhbGi2vqop9NlbnNUMyVoukJ9yoc9dIag4fQChs7Vx91WBA6YmcONzr259mZb2GkIOGxPGtPFYfg==","signatures":[{"sig":"MEYCIQCcW8DfoH5YFrAVmoGONGq18MxfhFo8tfOJ7a/5EgoeiQIhAP2+JnG+gUipJnAJEMXVeQYwf7zvmqDGFR0pCCnfs61b","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"size":9933055,"noattachment":false,"key":"/tchannel/-/tchannel-2.2.2.tgz"},"main":"channel","_from":".","_shasum":"0da92d7c131e889e9dece10469eb89819e3cf764","gitHead":"7e8994f2362519f7edf8a00e7a0700c3b92ce230","scripts":{"lint":"jshint .","test":"npm run check-licence && npm run lint -s && npm run cover -s && npm run check-benchmark -s","cover":"istanbul cover --report html --print none test/index.js -- --color | faucet && istanbul report text && istanbul check-coverage","benchmark":"echo '!!! DEPRECATED: Better to just run `node benchmarks` directly' >&2; node benchmarks","view-cover":"opn coverage/index.html","add-licence":"uber-licence","check-cover":"istanbul check-coverage","check-licence":"uber-licence --dry","take-benchmark":"make -C benchmarks take","check-benchmark":"node benchmarks -- -r 10000 -p 10000","take-relay-benchmark":"make -C benchmarks take_relay","take-trace-benchmark":"amke -C benchmarks take_trace"},"_npmUser":{"name":"jcorbin","email":"jcorbin@wunjo.org"},"pre-commit":[],"repository":{"url":"git@github.com:uber/tchannel","type":"git"},"_npmVersion":"1.4.28","description":"network multiplexing and framing protocol for RPC or parser drag racing","directories":{},"dependencies":{"crc":"^3.2.1","bufrw":"^0.9.24","error":"^7.0.1","hexer":"^1.4.5","xtend":"^4.0.0","farmhash":"^0.2.0","lru-cache":"^2.6.4","thriftify":"1.0.0-alpha14","run-series":"^1.1.2","sse4_crc32":"^3.1.0","ready-signal":"^1.1.1","run-parallel":"^1.1.0","tape-cluster":"2.1.0","debug-logtron":"5.0.0","readable-stream":"1.0.33","uber-statsd-client":"1.3.2","json-stringify-safe":"^5.0.0"},"devDependencies":{"opn":"^1.0.1","once":"^1.3.1","tape":"^4.0.0","async":"^0.9.0","chalk":"^1.0.0","replr":"^1.0.4","faucet":"0.0.1","jshint":"^2.5.6","split2":"^0.2.1","logtron":"^8.1.0","metrics":"^0.1.8","process":"0.11.1","duplexer":"^0.1.1","istanbul":"^0.3.13","minimist":"^1.1.0","through2":"^0.6.3","child_pty":"^0.5.1","time-mock":"^0.1.2","ansi-color":"^0.2.1","my-local-ip":"1.0.0","format-stack":"4.1.1","uber-licence":"^1.1.0","ldjson-stream":"^1.2.1","safe-json-parse":"^4.0.0"},"pre-commit.silent":true,"readme":"# TChannel\n\nnetwork multiplexing and framing protocol for RPC\n\n## Stability: stable\n\n[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)\n\n## Example\n\n```js\nvar TChannel = require('tchannel');\n\nvar server = new TChannel();\nvar client = new TChannel();\n\nvar serverChan = server.makeSubChannel({\n    serviceName: 'server'\n});\n\n// normal response\nserverChan.register('func1', function onReq(req, res, arg2, arg3) {\n    console.log('func1 responding', { arg2: arg2.toString(), arg3: arg3.toString() });\n    res.headers.as = 'raw';\n    res.sendOk('result', 'indeed it did');\n});\n\n// err response\nserverChan.register('func2', function onReq2(req, res) {\n    res.headers.as = 'raw';\n    res.sendNotOk(null, 'it failed');\n});\n\nserver.listen(4040, '127.0.0.1', function onListen() {\n    var clientChan = client.makeSubChannel({\n        serviceName: 'server',\n        peers: [server.hostPort],\n        requestDefaults: {\n            hasNoParent: true,\n            headers: { 'as': 'raw', 'cn': 'example-client' }\n        }\n    });\n\n    clientChan.request({\n        serviceName: 'server',\n        timeout: 1000\n    }).send('func1', 'arg 1', 'arg 2', function onResp(err, res, arg2, arg3) {\n        console.log('normal res:', { arg2: arg2.toString(), arg3: arg3.toString() });\n    });\n\n    clientChan.request({\n        serviceName: 'server'\n    }).send('func2', 'arg 1', 'arg 2', function onResp(err, res, arg2, arg3) {\n        console.log('err res: ', { ok: res.ok, message: String(arg3) });\n    });\n});\n```\n\nThis example registers two functions on the \"server\". \"func 1\" always works and \"func 2\" always\nreturns an error. The client sends a request for each function, then prints the result.\n\nNote that every instance is bidirectional. New connections are initiated on demand.\n\n## Overview\n\nTChannel is a network protocol with the following goals:\n\n * request / response model\n * multiple requests multiplexed across the same TCP socket\n * out of order responses\n * streaming request and responses\n * all frames checksummed\n * transport arbitrary payloads\n * easy to implement in multiple languages\n * near-redis performance\n\nThis protocol is intended to run on datacenter networks for inter-process communication.\n\n## Protocol\n\nTChannel frames have a fixed length header and 3 variable length fields. The underlying protocol\ndoes not assign meaning to these fields, but the included client/server implementation uses\nthe first field to represent a unique endpoint or function name in an RPC model.\nThe next two fields can be used for arbitrary data. Some suggested way to use the 3 fields are:\n\n* URI path, HTTP method and headers as JSON, body\n* function name, headers, thrift / protobuf\n\nNote however that the only encoding supported by TChannel is UTF-8.  If you want JSON, you'll need\nto stringify and parse outside of TChannel.\n\nThis design supports efficient routing and forwarding of data where the routing information needs\nto parse only the first or second field, but the 3rd field is forwarded without parsing.\n\nThere is no notion of client and server in this system. Every TChannel instance is capable of\nmaking or receiving requests, and thus requires a unique port on which to listen. This requirement may\nchange in the future.\n\n - See [protocol.md](../docs/protocol.md) for more details\n\n## Performance\n\nOn a Macbook Pro, we see around 50,000 ops/sec from a single node process talking to one other node process.\n\n## Documentation\n\nSee the [docs](./docs/) folder.\n\n## Further examples\n\nSee the [examples](./examples/) folder\n\n## Installation\n\n`npm install tchannel`\n\n## Tests\n\n`npm test`\n\n## Contributors\n\n - mranney\n - jwolski\n - Raynos\n - jcorbin\n - kriskowal\n - shannili\n - rf\n\n## MIT Licenced\n","publish_time":1437092242109,"_cnpm_publish_time":1437092242109,"dist-tags":{"2.":"2.10.8","alpha":"3.9.11","beta":"3.6.10","latest":"3.9.15","test":"3.6.18-min-connections"}}