GithubHelp home page GithubHelp logo

flarnie / fbthrift Goto Github PK

View Code? Open in Web Editor NEW

This project forked from facebook/fbthrift

0.0 2.0 0.0 24.07 MB

Facebook's branch of Apache Thrift, including a new C++ server.

License: Apache License 2.0

CMake 0.13% Python 13.56% Shell 0.08% C++ 64.63% HTML 1.58% Ruby 1.17% C 0.60% Thrift 0.96% Hack 2.97% Java 8.65% PHP 1.20% Objective-C 0.54% Haskell 1.10% Lex 0.04% Yacc 0.13% Emacs Lisp 0.02% Vim Script 0.01% TeX 0.18% D 2.41% Makefile 0.06%

fbthrift's Introduction

Facebook Thrift Build Status

Thrift is a serialization and RPC framework for service communication. Thrift enables these features in all major languages, and there is strong support for C++, Python, Hack, and Java. Most services at Facebook are written using Thrift for RPC, and some storage systems use Thrift for serializing records on disk.

At a high level, Thrift is three major things:

A Code Generator

Thrift has a code generator which generates data structures that can be serialized using Thrift, and client and server stubs for RPC, in different languages.

A Serialization Framework

Thrift has a set of protocols for serialization that may be used in different languages to serialize the generated structures created from the code generator.

An RPC Framework

Thrift has a framework to frame messages to send between clients and servers, and to call application-defined functions when receiving messages in different languages.

There are several key goals for these components:

  • Ease of use Thrift takes care of the boilerplate of serialization and RPC, and enables the developer to focus on the schema of the system's serializable types and on the interfaces of system's RPC services.

  • Cross language support Thrift enables intercommunication between different languages. For example, a Python client communicating with a C++ server.

  • Performance Thrift structures and services enable fast serialization and deserialization, and its RPC protocol and frameworks are designed with performance as a feature.

  • Backwards compatibility Thrift allows fields to be added to and removed from serializable types in a manner that preserves backward and forward compatibility.

Building

Dependencies

Please install the following dependencies before building Facebook Thrift:

System: Flex, Bison, Krb5, Zlib, PThreads. MacOSX: OpenSSLv1.0.2g

External: Double Conversion, GFlags, GLog, Mstch

Facebook: Folly, Wangle, Zstd

Build

git clone https://github.com/facebook/fbthrift
cd build
cmake .. # Add -DOPENSSL_ROOT_DIR for MacOSX. Usually in /usr/local/ssl
make # or make -j $(nproc), or make install.

This will create:

  • thrift/bin/thrift1: The Thrift compiler binary to generate client and server code.
  • thrift/lib/libthriftcpp2.so: Runtime library for clients and servers.

Thrift Files

When using thrift and the CMake build system, include: ThriftLibrary.cmake in your project. This includes the following macro to help when building Thrift files:

thrift_library(
  #file_name
  #services
  #language
  #options
  #file_path
  #output_path
)

This generates a library called: file_name-language. That is, for Test.thrift compiled as cpp2, it will generate the library Test-cpp2. This should be added as a dependency to any *.h or *.cpp file that contains an include to generated code.

C++ Static Reflection

Information regarding C++ Static Reflection support can be found under the static reflection library directory, in the corresponding README file.

fbthrift's People

Contributors

afrind avatar alandau avatar andrewcox avatar andrewjcg avatar ckwalsh avatar dcsommer avatar ddrcoder avatar dusty-phillips avatar eduardo-elizondo avatar fried avatar igorsugak avatar jesboat avatar luciang avatar mcdufffb avatar meyering avatar mhorowitz avatar mshneer avatar ngoyal avatar orvid avatar ot avatar pankdm-fb avatar philippv avatar roticv avatar shamdor-fb avatar simpkins avatar siyengar avatar snarkmaster avatar tudor avatar wez avatar yfeldblum avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.