Go to the source code of this file.
DEFINE_int32 |
( |
port |
, |
|
|
8080 |
, |
|
|
"test server port" |
|
|
) |
| |
DEFINE_string |
( |
host |
, |
|
|
"::1" |
, |
|
|
"test server address" |
|
|
) |
| |
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
For specific protocols, all the following code would be wrapped in a protocol-specific ServiceFactories.
TODO: examples of ServiceFactoryFilters, for connection pooling, etc.
Definition at line 98 of file RpcClient.cpp.
References wangle::ClientBootstrap< Pipeline >::connect(), folly::exceptionStr(), wangle::ClientBootstrap< Pipeline >::group(), folly::init(), and wangle::BaseClientBootstrap< Pipeline >::pipelineFactory().
108 client.
group(std::make_shared<folly::IOThreadPoolExecutor>(1));
117 auto dispatcher = std::make_shared<BonkMultiplexClientDispatcher>();
118 dispatcher->setPipeline(pipeline);
125 std::cout <<
"Input string and int" << std::endl;
128 std::cin >> request.message;
129 std::cin >> request.type;
130 service(request).thenValue([request](Xtruct response) {
131 CHECK(request.type == response.i32_thing);
132 std::cout << response.string_thing << std::endl;
135 }
catch (
const std::exception& e) {
fbstring exceptionStr(const std::exception &e)
folly::Future< Pipeline * > connect(const folly::SocketAddress &address, std::chrono::milliseconds timeout=std::chrono::milliseconds(0)) override
BaseClientBootstrap< Pipeline > * pipelineFactory(std::shared_ptr< PipelineFactory< Pipeline >> factory) noexcept
ClientBootstrap * group(std::shared_ptr< folly::IOThreadPoolExecutor > group)