rewrite RPC framework with Thrift