2 * Autogenerated by Thrift
4 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
8 #include <src/gen-py3/module/services_wrapper.h>
9 #include <src/gen-py3/module/services_api.h>
10 #include <thrift/lib/cpp2/async/AsyncProcessor.h>
16 MyServiceWrapper::MyServiceWrapper(PyObject
*obj
, folly::Executor
* exc
)
17 : if_object(obj
), executor(exc
)
19 import_test__fixtures__basic__module__services();
23 void MyServiceWrapper::async_tm_query(
24 std::unique_ptr
<apache::thrift::HandlerCallback
<std::unique_ptr
<::test::fixtures::basic::MyStruct
>>> callback
25 , std::unique_ptr
<::test::fixtures::basic::MyUnion
> u
27 auto ctx
= callback
->getRequestContext();
31 callback
= std::move(callback
),
32 u
= std::move(u
) ]() mutable {
33 auto [promise
, future
] = folly::makePromiseContract
<std::unique_ptr
<::test::fixtures::basic::MyStruct
>>();
34 call_cy_MyService_query(
39 std::move(future
).via(this->executor
).thenTry([callback
= std::move(callback
)](folly::Try
<std::unique_ptr
<::test::fixtures::basic::MyStruct
>>&& t
) {
41 callback
->complete(std::move(t
));
45 std::shared_ptr
<apache::thrift::ServerInterface
> MyServiceInterface(PyObject
*if_object
, folly::Executor
*exc
) {
46 return std::make_shared
<MyServiceWrapper
>(if_object
, exc
);
48 folly::SemiFuture
<folly::Unit
> MyServiceWrapper::semifuture_onStartServing() {
49 auto [promise
, future
] = folly::makePromiseContract
<folly::Unit
>();
50 call_cy_MyService_onStartServing(
54 return std::move(future
);
56 folly::SemiFuture
<folly::Unit
> MyServiceWrapper::semifuture_onStopRequested() {
57 auto [promise
, future
] = folly::makePromiseContract
<folly::Unit
>();
58 call_cy_MyService_onStopRequested(
62 return std::move(future
);
65 } // namespace fixtures