You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Ulric Qin 70e2cefd98
go mod vendor
4 years ago
..
internal/argreader go mod vendor 4 years ago
relay go mod vendor 4 years ago
thrift go mod vendor 4 years ago
tnet go mod vendor 4 years ago
tos go mod vendor 4 years ago
trand go mod vendor 4 years ago
typed go mod vendor 4 years ago
.gitignore go mod vendor 4 years ago
.travis.yml go mod vendor 4 years ago
CHANGELOG.md go mod vendor 4 years ago
CODE_OF_CONDUCT.md go mod vendor 4 years ago
CONTRIBUTING.md go mod vendor 4 years ago
LICENSE.md go mod vendor 4 years ago
Makefile go mod vendor 4 years ago
README.md go mod vendor 4 years ago
RELEASE.md go mod vendor 4 years ago
all_channels.go go mod vendor 4 years ago
arguments.go go mod vendor 4 years ago
calloptions.go go mod vendor 4 years ago
channel.go go mod vendor 4 years ago
channelstate_string.go go mod vendor 4 years ago
checksum.go go mod vendor 4 years ago
codecov.yml go mod vendor 4 years ago
connection.go go mod vendor 4 years ago
connection_direction.go go mod vendor 4 years ago
connectionstate_string.go go mod vendor 4 years ago
context.go go mod vendor 4 years ago
context_builder.go go mod vendor 4 years ago
context_header.go go mod vendor 4 years ago
dial_16.go go mod vendor 4 years ago
dial_17.go go mod vendor 4 years ago
doc.go go mod vendor 4 years ago
errors.go go mod vendor 4 years ago
fragmenting_reader.go go mod vendor 4 years ago
fragmenting_writer.go go mod vendor 4 years ago
frame.go go mod vendor 4 years ago
frame_pool.go go mod vendor 4 years ago
glide.lock go mod vendor 4 years ago
glide.yaml go mod vendor 4 years ago
handlers.go go mod vendor 4 years ago
health.go go mod vendor 4 years ago
idle_sweep.go go mod vendor 4 years ago
inbound.go go mod vendor 4 years ago
introspection.go go mod vendor 4 years ago
localip.go go mod vendor 4 years ago
logger.go go mod vendor 4 years ago
messages.go go mod vendor 4 years ago
messagetype_string.go go mod vendor 4 years ago
mex.go go mod vendor 4 years ago
outbound.go go mod vendor 4 years ago
peer.go go mod vendor 4 years ago
peer_heap.go go mod vendor 4 years ago
peer_strategies.go go mod vendor 4 years ago
preinit_connection.go go mod vendor 4 years ago
relay.go go mod vendor 4 years ago
relay_api.go go mod vendor 4 years ago
relay_messages.go go mod vendor 4 years ago
relay_timer_pool.go go mod vendor 4 years ago
reqres.go go mod vendor 4 years ago
reqresreaderstate_string.go go mod vendor 4 years ago
reqreswriterstate_string.go go mod vendor 4 years ago
retry.go go mod vendor 4 years ago
retryon_string.go go mod vendor 4 years ago
root_peer_list.go go mod vendor 4 years ago
stats.go go mod vendor 4 years ago
subchannel.go go mod vendor 4 years ago
systemerrcode_string.go go mod vendor 4 years ago
tracing.go go mod vendor 4 years ago
tracing_keys.go go mod vendor 4 years ago
version.go go mod vendor 4 years ago

README.md

TChannel GoDoc Build Status Coverage Status

TChannel is a multiplexing and framing protocol for RPC calls. tchannel-go is a Go implementation of the protocol, including client libraries for Hyperbahn.

If you'd like to start by writing a small Thrift and TChannel service, check out this guide. For a less opinionated setup, see the contribution guidelines.

Overview

TChannel is a network protocol that supports:

  • A request/response model,
  • Multiplexing multiple requests across the same TCP socket,
  • Out-of-order responses,
  • Streaming requests and responses,
  • Checksummed frames,
  • Transport of arbitrary payloads,
  • Easy implementation in many languages, and
  • Redis-like performance.

This protocol is intended to run on datacenter networks for inter-process communication.

Protocol

TChannel frames have a fixed-length header and 3 variable-length fields. The underlying protocol does not assign meaning to these fields, but the included client/server implementation uses the first field to represent a unique endpoint or function name in an RPC model. The next two fields can be used for arbitrary data. Some suggested way to use the 3 fields are:

  • URI path + HTTP method and headers as JSON + body, or
  • Function name + headers + thrift/protobuf.

Note, however, that the only encoding supported by TChannel is UTF-8. If you want JSON, you'll need to stringify and parse outside of TChannel.

This design supports efficient routing and forwarding: routers need to parse the first or second field, but can forward the third field without parsing.

There is no notion of client and server in this system. Every TChannel instance is capable of making and receiving requests, and thus requires a unique port on which to listen. This requirement may change in the future.

See the protocol specification for more details.

Examples

  • ping: A simple ping/pong example using raw TChannel.
  • thrift: A Thrift server/client example.
  • keyvalue: A keyvalue Thrift service with separate server and client binaries.

This project is released under the [MIT License](LICENSE.md).