1 /**
2  * Autogenerated by Thrift
3  *
4  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5  *  @generated
6  */
7 
8 #include <src/gen-py3/module/clients_wrapper.h>
9 
10 namespace cpp2 {
11 
12 
13 folly::Future<folly::Unit>
foo(apache::thrift::RpcOptions & rpcOptions)14 MyServiceClientWrapper::foo(
15     apache::thrift::RpcOptions& rpcOptions) {
16   auto* client = static_cast<::cpp2::MyServiceAsyncClient*>(async_client_.get());
17   folly::Promise<folly::Unit> _promise;
18   auto _future = _promise.getFuture();
19   auto callback = std::make_unique<::thrift::py3::FutureCallback<folly::Unit>>(
20     std::move(_promise), rpcOptions, client->recv_wrapped_foo, channel_);
21   client->foo(
22     rpcOptions,
23     std::move(callback)
24   );
25   return _future;
26 }
27 
28 
29 folly::Future<std::unique_ptr<::thrift::py3::ClientWrapper>>
createMyInteraction()30 MyServiceClientWrapper::createMyInteraction() {
31   return folly::via(
32       channel_->getEventBase(),
33       [=]() -> std::unique_ptr<::thrift::py3::ClientWrapper> {
34         auto interaction_client = static_cast<std::unique_ptr<apache::thrift::GeneratedAsyncClient>>(std::make_unique<MyServiceAsyncClient::MyInteraction>(((MyServiceAsyncClient*)async_client_.get())->createMyInteraction()));
35         return static_cast<std::unique_ptr<::thrift::py3::ClientWrapper>>(std::make_unique<MyInteractionInteractionWrapper>(std::move(interaction_client), channel_));
36       }
37   );
38 }
39 
40 
41 folly::Future<std::unique_ptr<::thrift::py3::ClientWrapper>>
createMyInteractionFast()42 MyServiceClientWrapper::createMyInteractionFast() {
43   return folly::via(
44       channel_->getEventBase(),
45       [=]() -> std::unique_ptr<::thrift::py3::ClientWrapper> {
46         auto interaction_client = static_cast<std::unique_ptr<apache::thrift::GeneratedAsyncClient>>(std::make_unique<MyServiceAsyncClient::MyInteractionFast>(((MyServiceAsyncClient*)async_client_.get())->createMyInteractionFast()));
47         return static_cast<std::unique_ptr<::thrift::py3::ClientWrapper>>(std::make_unique<MyInteractionFastInteractionWrapper>(std::move(interaction_client), channel_));
48       }
49   );
50 }
51 
52 
53 folly::Future<std::unique_ptr<::thrift::py3::ClientWrapper>>
createSerialInteraction()54 MyServiceClientWrapper::createSerialInteraction() {
55   return folly::via(
56       channel_->getEventBase(),
57       [=]() -> std::unique_ptr<::thrift::py3::ClientWrapper> {
58         auto interaction_client = static_cast<std::unique_ptr<apache::thrift::GeneratedAsyncClient>>(std::make_unique<MyServiceAsyncClient::SerialInteraction>(((MyServiceAsyncClient*)async_client_.get())->createSerialInteraction()));
59         return static_cast<std::unique_ptr<::thrift::py3::ClientWrapper>>(std::make_unique<SerialInteractionInteractionWrapper>(std::move(interaction_client), channel_));
60       }
61   );
62 }
63 
64 folly::Future<int32_t>
frobnicate(apache::thrift::RpcOptions & rpcOptions)65 MyServiceClientWrapper::MyInteractionInteractionWrapper::frobnicate(
66     apache::thrift::RpcOptions& rpcOptions) {
67   auto* client = static_cast<::cpp2::MyServiceAsyncClient::MyInteraction*>(async_client_.get());
68   folly::Promise<int32_t> _promise;
69   auto _future = _promise.getFuture();
70   auto callback = std::make_unique<::thrift::py3::FutureCallback<int32_t>>(
71     std::move(_promise), rpcOptions, client->recv_wrapped_frobnicate, channel_);
72   client->frobnicate(
73     rpcOptions,
74     std::move(callback)
75   );
76   return _future;
77 }
78 
79 folly::Future<folly::Unit>
ping(apache::thrift::RpcOptions & rpcOptions)80 MyServiceClientWrapper::MyInteractionInteractionWrapper::ping(
81     apache::thrift::RpcOptions& rpcOptions) {
82   auto* client = static_cast<::cpp2::MyServiceAsyncClient::MyInteraction*>(async_client_.get());
83   folly::Promise<folly::Unit> _promise;
84   auto _future = _promise.getFuture();
85   auto callback = std::make_unique<::apache::thrift::OneWayFutureCallback>(
86     std::move(_promise), channel_);
87   client->ping(
88     rpcOptions,
89     std::move(callback)
90   );
91   return _future;
92 }
93 
94 folly::Future<apache::thrift::ClientBufferedStream<bool>>
truthify(apache::thrift::RpcOptions & rpcOptions)95 MyServiceClientWrapper::MyInteractionInteractionWrapper::truthify(
96     apache::thrift::RpcOptions& rpcOptions) {
97   auto* client = static_cast<::cpp2::MyServiceAsyncClient::MyInteraction*>(async_client_.get());
98   folly::Promise<apache::thrift::ClientBufferedStream<bool>> _promise;
99   auto _future = _promise.getFuture();
100   auto callback = std::make_unique<::thrift::py3::FutureCallback<apache::thrift::ClientBufferedStream<bool>>>(
101     std::move(_promise), rpcOptions, client->recv_wrapped_truthify, channel_);
102   client->truthify(
103     rpcOptions,
104     std::move(callback)
105   );
106   return _future;
107 }
108 
109 folly::Future<int32_t>
frobnicate(apache::thrift::RpcOptions & rpcOptions)110 MyServiceClientWrapper::MyInteractionFastInteractionWrapper::frobnicate(
111     apache::thrift::RpcOptions& rpcOptions) {
112   auto* client = static_cast<::cpp2::MyServiceAsyncClient::MyInteractionFast*>(async_client_.get());
113   folly::Promise<int32_t> _promise;
114   auto _future = _promise.getFuture();
115   auto callback = std::make_unique<::thrift::py3::FutureCallback<int32_t>>(
116     std::move(_promise), rpcOptions, client->recv_wrapped_frobnicate, channel_);
117   client->frobnicate(
118     rpcOptions,
119     std::move(callback)
120   );
121   return _future;
122 }
123 
124 folly::Future<folly::Unit>
ping(apache::thrift::RpcOptions & rpcOptions)125 MyServiceClientWrapper::MyInteractionFastInteractionWrapper::ping(
126     apache::thrift::RpcOptions& rpcOptions) {
127   auto* client = static_cast<::cpp2::MyServiceAsyncClient::MyInteractionFast*>(async_client_.get());
128   folly::Promise<folly::Unit> _promise;
129   auto _future = _promise.getFuture();
130   auto callback = std::make_unique<::apache::thrift::OneWayFutureCallback>(
131     std::move(_promise), channel_);
132   client->ping(
133     rpcOptions,
134     std::move(callback)
135   );
136   return _future;
137 }
138 
139 folly::Future<apache::thrift::ClientBufferedStream<bool>>
truthify(apache::thrift::RpcOptions & rpcOptions)140 MyServiceClientWrapper::MyInteractionFastInteractionWrapper::truthify(
141     apache::thrift::RpcOptions& rpcOptions) {
142   auto* client = static_cast<::cpp2::MyServiceAsyncClient::MyInteractionFast*>(async_client_.get());
143   folly::Promise<apache::thrift::ClientBufferedStream<bool>> _promise;
144   auto _future = _promise.getFuture();
145   auto callback = std::make_unique<::thrift::py3::FutureCallback<apache::thrift::ClientBufferedStream<bool>>>(
146     std::move(_promise), rpcOptions, client->recv_wrapped_truthify, channel_);
147   client->truthify(
148     rpcOptions,
149     std::move(callback)
150   );
151   return _future;
152 }
153 
154 folly::Future<folly::Unit>
frobnicate(apache::thrift::RpcOptions & rpcOptions)155 MyServiceClientWrapper::SerialInteractionInteractionWrapper::frobnicate(
156     apache::thrift::RpcOptions& rpcOptions) {
157   auto* client = static_cast<::cpp2::MyServiceAsyncClient::SerialInteraction*>(async_client_.get());
158   folly::Promise<folly::Unit> _promise;
159   auto _future = _promise.getFuture();
160   auto callback = std::make_unique<::thrift::py3::FutureCallback<folly::Unit>>(
161     std::move(_promise), rpcOptions, client->recv_wrapped_frobnicate, channel_);
162   client->frobnicate(
163     rpcOptions,
164     std::move(callback)
165   );
166   return _future;
167 }
168 
169 } // namespace cpp2
170