Skip to content

Commit f51672c

Browse files
Dan Dengmeta-codesync[bot]
authored andcommitted
Change ResponseChannel::sendSinkReply to accept ServerSinkFactory
Reviewed By: evanjzou Differential Revision: D89140244 fbshipit-source-id: 167749e36ed8998a4566a6ec7605cbe6166da8a9
1 parent abdfbd2 commit f51672c

30 files changed

Lines changed: 292 additions & 124 deletions

File tree

third-party/thrift/src/thrift/compiler/generate/templates/cpp2/service_h/async_processor_per_function.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
{{#else if function:self.sink?}}
6060
static std::pair<
6161
apache::thrift::SerializedResponse,
62-
apache::thrift::detail::SinkConsumerImpl>
62+
apache::thrift::detail::ServerSinkFactory>
6363
return_{{function:prefixed_name}}(
6464
apache::thrift::ContextStack* ctx,
6565
{{function:cpp_return_type}}&& _return,

third-party/thrift/src/thrift/compiler/generate/templates/cpp2/service_tcc/process_and_return.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ template <class ProtocolIn_, class ProtocolOut_>
336336
{{#else if function:self.sink?}}
337337
/* static */ std::pair<
338338
apache::thrift::SerializedResponse,
339-
apache::thrift::detail::SinkConsumerImpl>
339+
apache::thrift::detail::ServerSinkFactory>
340340
{{service:parent_service_cpp_name}}AsyncProcessor::return_{{function:prefixed_name}}(
341341
apache::thrift::ContextStack* ctx,
342342
{{function:cpp_return_type}}&& _return,
@@ -382,7 +382,7 @@ template <class ProtocolIn_, class ProtocolOut_>
382382
result.get<0>().value = &_return.response;
383383
result.setIsSet(0, true);
384384
{{/if function:sink_has_first_response?}}
385-
auto sinkConsumerImpl = apache::thrift::detail::ap::toSinkConsumerImpl<
385+
auto sinkConsumerImpl = apache::thrift::detail::ap::toServerSinkFactory<
386386
ProtocolIn_,
387387
ProtocolOut_,
388388
SinkPResultType,
@@ -441,7 +441,7 @@ void {{service:parent_service_cpp_name}}AsyncProcessor::throw_wrapped_{{function
441441
{{#else if function:stream?}}
442442
req->sendStreamReply(std::move(payload), apache::thrift::detail::ServerStreamFactory{nullptr});
443443
{{#else if function:sink?}}
444-
req->sendSinkReply(std::move(payload), apache::thrift::detail::SinkConsumerImpl{});
444+
req->sendSinkReply(std::move(payload), apache::thrift::detail::ServerSinkFactory{});
445445
{{#else}}
446446
return req->sendReply(std::move(payload));
447447
{{/if function:bidirectional_stream?}}

third-party/thrift/src/thrift/compiler/test/fixtures/interactions/out/cpp2/gen-cpp2/Factories.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ class FactoriesAsyncProcessor : public ::apache::thrift::GeneratedAsyncProcessor
580580
template <class ProtocolIn_, class ProtocolOut_>
581581
static std::pair<
582582
apache::thrift::SerializedResponse,
583-
apache::thrift::detail::SinkConsumerImpl>
583+
apache::thrift::detail::ServerSinkFactory>
584584
return_MyInteraction_encode(
585585
apache::thrift::ContextStack* ctx,
586586
::apache::thrift::ResponseAndSinkConsumer<::std::set<::std::int32_t>, ::std::string, ::std::string>&& _return,
@@ -721,7 +721,7 @@ class FactoriesAsyncProcessor : public ::apache::thrift::GeneratedAsyncProcessor
721721
template <class ProtocolIn_, class ProtocolOut_>
722722
static std::pair<
723723
apache::thrift::SerializedResponse,
724-
apache::thrift::detail::SinkConsumerImpl>
724+
apache::thrift::detail::ServerSinkFactory>
725725
return_MyInteractionFast_encode(
726726
apache::thrift::ContextStack* ctx,
727727
::apache::thrift::ResponseAndSinkConsumer<::std::set<::std::int32_t>, ::std::string, ::std::string>&& _return,

third-party/thrift/src/thrift/compiler/test/fixtures/interactions/out/cpp2/gen-cpp2/Factories.tcc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,7 +1419,7 @@ void FactoriesAsyncProcessor::executeRequest_MyInteraction_encode(
14191419
template <class ProtocolIn_, class ProtocolOut_>
14201420
/* static */ std::pair<
14211421
apache::thrift::SerializedResponse,
1422-
apache::thrift::detail::SinkConsumerImpl>
1422+
apache::thrift::detail::ServerSinkFactory>
14231423
FactoriesAsyncProcessor::return_MyInteraction_encode(
14241424
apache::thrift::ContextStack* ctx,
14251425
::apache::thrift::ResponseAndSinkConsumer<::std::set<::std::int32_t>, ::std::string, ::std::string>&& _return,
@@ -1431,7 +1431,7 @@ FactoriesAsyncProcessor::return_MyInteraction_encode(
14311431
Factories_MyInteraction_encode_presult::FinalResponsePResultType;
14321432
result.get<0>().value = &_return.response;
14331433
result.setIsSet(0, true);
1434-
auto sinkConsumerImpl = apache::thrift::detail::ap::toSinkConsumerImpl<
1434+
auto sinkConsumerImpl = apache::thrift::detail::ap::toServerSinkFactory<
14351435
ProtocolIn_,
14361436
ProtocolOut_,
14371437
SinkPResultType,
@@ -2122,7 +2122,7 @@ void FactoriesAsyncProcessor::executeRequest_MyInteractionFast_encode(
21222122
template <class ProtocolIn_, class ProtocolOut_>
21232123
/* static */ std::pair<
21242124
apache::thrift::SerializedResponse,
2125-
apache::thrift::detail::SinkConsumerImpl>
2125+
apache::thrift::detail::ServerSinkFactory>
21262126
FactoriesAsyncProcessor::return_MyInteractionFast_encode(
21272127
apache::thrift::ContextStack* ctx,
21282128
::apache::thrift::ResponseAndSinkConsumer<::std::set<::std::int32_t>, ::std::string, ::std::string>&& _return,
@@ -2134,7 +2134,7 @@ FactoriesAsyncProcessor::return_MyInteractionFast_encode(
21342134
Factories_MyInteractionFast_encode_presult::FinalResponsePResultType;
21352135
result.get<0>().value = &_return.response;
21362136
result.setIsSet(0, true);
2137-
auto sinkConsumerImpl = apache::thrift::detail::ap::toSinkConsumerImpl<
2137+
auto sinkConsumerImpl = apache::thrift::detail::ap::toServerSinkFactory<
21382138
ProtocolIn_,
21392139
ProtocolOut_,
21402140
SinkPResultType,

third-party/thrift/src/thrift/compiler/test/fixtures/interactions/out/cpp2/gen-cpp2/InteractWithShared.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ class InteractWithSharedAsyncProcessor : public ::apache::thrift::GeneratedAsync
444444
template <class ProtocolIn_, class ProtocolOut_>
445445
static std::pair<
446446
apache::thrift::SerializedResponse,
447-
apache::thrift::detail::SinkConsumerImpl>
447+
apache::thrift::detail::ServerSinkFactory>
448448
return_MyInteraction_encode(
449449
apache::thrift::ContextStack* ctx,
450450
::apache::thrift::ResponseAndSinkConsumer<::std::set<::std::int32_t>, ::std::string, ::std::string>&& _return,

third-party/thrift/src/thrift/compiler/test/fixtures/interactions/out/cpp2/gen-cpp2/InteractWithShared.tcc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ void InteractWithSharedAsyncProcessor::executeRequest_MyInteraction_encode(
884884
template <class ProtocolIn_, class ProtocolOut_>
885885
/* static */ std::pair<
886886
apache::thrift::SerializedResponse,
887-
apache::thrift::detail::SinkConsumerImpl>
887+
apache::thrift::detail::ServerSinkFactory>
888888
InteractWithSharedAsyncProcessor::return_MyInteraction_encode(
889889
apache::thrift::ContextStack* ctx,
890890
::apache::thrift::ResponseAndSinkConsumer<::std::set<::std::int32_t>, ::std::string, ::std::string>&& _return,
@@ -896,7 +896,7 @@ InteractWithSharedAsyncProcessor::return_MyInteraction_encode(
896896
InteractWithShared_MyInteraction_encode_presult::FinalResponsePResultType;
897897
result.get<0>().value = &_return.response;
898898
result.setIsSet(0, true);
899-
auto sinkConsumerImpl = apache::thrift::detail::ap::toSinkConsumerImpl<
899+
auto sinkConsumerImpl = apache::thrift::detail::ap::toServerSinkFactory<
900900
ProtocolIn_,
901901
ProtocolOut_,
902902
SinkPResultType,

third-party/thrift/src/thrift/compiler/test/fixtures/interactions/out/cpp2/gen-cpp2/MyService.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ class MyServiceAsyncProcessor : public ::apache::thrift::GeneratedAsyncProcessor
631631
template <class ProtocolIn_, class ProtocolOut_>
632632
static std::pair<
633633
apache::thrift::SerializedResponse,
634-
apache::thrift::detail::SinkConsumerImpl>
634+
apache::thrift::detail::ServerSinkFactory>
635635
return_MyInteraction_encode(
636636
apache::thrift::ContextStack* ctx,
637637
::apache::thrift::ResponseAndSinkConsumer<::std::set<::std::int32_t>, ::std::string, ::std::string>&& _return,
@@ -772,7 +772,7 @@ class MyServiceAsyncProcessor : public ::apache::thrift::GeneratedAsyncProcessor
772772
template <class ProtocolIn_, class ProtocolOut_>
773773
static std::pair<
774774
apache::thrift::SerializedResponse,
775-
apache::thrift::detail::SinkConsumerImpl>
775+
apache::thrift::detail::ServerSinkFactory>
776776
return_MyInteractionFast_encode(
777777
apache::thrift::ContextStack* ctx,
778778
::apache::thrift::ResponseAndSinkConsumer<::std::set<::std::int32_t>, ::std::string, ::std::string>&& _return,

third-party/thrift/src/thrift/compiler/test/fixtures/interactions/out/cpp2/gen-cpp2/MyService.tcc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,7 +1419,7 @@ void MyServiceAsyncProcessor::executeRequest_MyInteraction_encode(
14191419
template <class ProtocolIn_, class ProtocolOut_>
14201420
/* static */ std::pair<
14211421
apache::thrift::SerializedResponse,
1422-
apache::thrift::detail::SinkConsumerImpl>
1422+
apache::thrift::detail::ServerSinkFactory>
14231423
MyServiceAsyncProcessor::return_MyInteraction_encode(
14241424
apache::thrift::ContextStack* ctx,
14251425
::apache::thrift::ResponseAndSinkConsumer<::std::set<::std::int32_t>, ::std::string, ::std::string>&& _return,
@@ -1431,7 +1431,7 @@ MyServiceAsyncProcessor::return_MyInteraction_encode(
14311431
MyService_MyInteraction_encode_presult::FinalResponsePResultType;
14321432
result.get<0>().value = &_return.response;
14331433
result.setIsSet(0, true);
1434-
auto sinkConsumerImpl = apache::thrift::detail::ap::toSinkConsumerImpl<
1434+
auto sinkConsumerImpl = apache::thrift::detail::ap::toServerSinkFactory<
14351435
ProtocolIn_,
14361436
ProtocolOut_,
14371437
SinkPResultType,
@@ -2122,7 +2122,7 @@ void MyServiceAsyncProcessor::executeRequest_MyInteractionFast_encode(
21222122
template <class ProtocolIn_, class ProtocolOut_>
21232123
/* static */ std::pair<
21242124
apache::thrift::SerializedResponse,
2125-
apache::thrift::detail::SinkConsumerImpl>
2125+
apache::thrift::detail::ServerSinkFactory>
21262126
MyServiceAsyncProcessor::return_MyInteractionFast_encode(
21272127
apache::thrift::ContextStack* ctx,
21282128
::apache::thrift::ResponseAndSinkConsumer<::std::set<::std::int32_t>, ::std::string, ::std::string>&& _return,
@@ -2134,7 +2134,7 @@ MyServiceAsyncProcessor::return_MyInteractionFast_encode(
21342134
MyService_MyInteractionFast_encode_presult::FinalResponsePResultType;
21352135
result.get<0>().value = &_return.response;
21362136
result.setIsSet(0, true);
2137-
auto sinkConsumerImpl = apache::thrift::detail::ap::toSinkConsumerImpl<
2137+
auto sinkConsumerImpl = apache::thrift::detail::ap::toServerSinkFactory<
21382138
ProtocolIn_,
21392139
ProtocolOut_,
21402140
SinkPResultType,

third-party/thrift/src/thrift/compiler/test/fixtures/interactions/out/cpp2/gen-cpp2/Perform.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ class PerformAsyncProcessor : public ::apache::thrift::GeneratedAsyncProcessorBa
475475
template <class ProtocolIn_, class ProtocolOut_>
476476
static std::pair<
477477
apache::thrift::SerializedResponse,
478-
apache::thrift::detail::SinkConsumerImpl>
478+
apache::thrift::detail::ServerSinkFactory>
479479
return_MyInteraction_encode(
480480
apache::thrift::ContextStack* ctx,
481481
::apache::thrift::ResponseAndSinkConsumer<::std::set<::std::int32_t>, ::std::string, ::std::string>&& _return,
@@ -616,7 +616,7 @@ class PerformAsyncProcessor : public ::apache::thrift::GeneratedAsyncProcessorBa
616616
template <class ProtocolIn_, class ProtocolOut_>
617617
static std::pair<
618618
apache::thrift::SerializedResponse,
619-
apache::thrift::detail::SinkConsumerImpl>
619+
apache::thrift::detail::ServerSinkFactory>
620620
return_MyInteractionFast_encode(
621621
apache::thrift::ContextStack* ctx,
622622
::apache::thrift::ResponseAndSinkConsumer<::std::set<::std::int32_t>, ::std::string, ::std::string>&& _return,

third-party/thrift/src/thrift/compiler/test/fixtures/interactions/out/cpp2/gen-cpp2/Perform.tcc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ void PerformAsyncProcessor::executeRequest_MyInteraction_encode(
881881
template <class ProtocolIn_, class ProtocolOut_>
882882
/* static */ std::pair<
883883
apache::thrift::SerializedResponse,
884-
apache::thrift::detail::SinkConsumerImpl>
884+
apache::thrift::detail::ServerSinkFactory>
885885
PerformAsyncProcessor::return_MyInteraction_encode(
886886
apache::thrift::ContextStack* ctx,
887887
::apache::thrift::ResponseAndSinkConsumer<::std::set<::std::int32_t>, ::std::string, ::std::string>&& _return,
@@ -893,7 +893,7 @@ PerformAsyncProcessor::return_MyInteraction_encode(
893893
Perform_MyInteraction_encode_presult::FinalResponsePResultType;
894894
result.get<0>().value = &_return.response;
895895
result.setIsSet(0, true);
896-
auto sinkConsumerImpl = apache::thrift::detail::ap::toSinkConsumerImpl<
896+
auto sinkConsumerImpl = apache::thrift::detail::ap::toServerSinkFactory<
897897
ProtocolIn_,
898898
ProtocolOut_,
899899
SinkPResultType,
@@ -1584,7 +1584,7 @@ void PerformAsyncProcessor::executeRequest_MyInteractionFast_encode(
15841584
template <class ProtocolIn_, class ProtocolOut_>
15851585
/* static */ std::pair<
15861586
apache::thrift::SerializedResponse,
1587-
apache::thrift::detail::SinkConsumerImpl>
1587+
apache::thrift::detail::ServerSinkFactory>
15881588
PerformAsyncProcessor::return_MyInteractionFast_encode(
15891589
apache::thrift::ContextStack* ctx,
15901590
::apache::thrift::ResponseAndSinkConsumer<::std::set<::std::int32_t>, ::std::string, ::std::string>&& _return,
@@ -1596,7 +1596,7 @@ PerformAsyncProcessor::return_MyInteractionFast_encode(
15961596
Perform_MyInteractionFast_encode_presult::FinalResponsePResultType;
15971597
result.get<0>().value = &_return.response;
15981598
result.setIsSet(0, true);
1599-
auto sinkConsumerImpl = apache::thrift::detail::ap::toSinkConsumerImpl<
1599+
auto sinkConsumerImpl = apache::thrift::detail::ap::toServerSinkFactory<
16001600
ProtocolIn_,
16011601
ProtocolOut_,
16021602
SinkPResultType,

0 commit comments

Comments
 (0)