Generate coroutine methods in service handlers by default
commit06dd950879942d25e09d092f99dcd0375e3feff6
authorPranjal Raihan <praihan@fb.com>
Mon, 29 Aug 2022 08:46:40 +0000 (29 01:46 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Mon, 29 Aug 2022 08:46:40 +0000 (29 01:46 -0700)
treee5abded93d9cc47f05c4625a4e6214823976e5fa
parent29f607423146cf2fff6d6d6316702ef266c40458
Generate coroutine methods in service handlers by default

Summary:
The `no_service_handler_coroutines` option disables coroutines by default.

`(cpp.coroutine)` ignores `no_service_handler_coroutines`.

The added fixtures cover these scenarios.

 ---

Reviewed By: ycking21

Differential Revision: D38590147

fbshipit-source-id: 94aef8d4a6cbac50d53d12fdce78b528aa27ddf6
117 files changed:
third-party/thrift/src/thrift/compiler/generate/t_mstch_cpp2_generator.cc
third-party/thrift/src/thrift/compiler/test/fixtures/adapter/gen-cpp2/Service.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/adapter/gen-cpp2/Service.h
third-party/thrift/src/thrift/compiler/test/fixtures/basic-annotations/gen-cpp2/BadService.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/basic-annotations/gen-cpp2/BadService.h
third-party/thrift/src/thrift/compiler/test/fixtures/basic-annotations/gen-cpp2/MyService.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/basic-annotations/gen-cpp2/MyService.h
third-party/thrift/src/thrift/compiler/test/fixtures/basic-annotations/gen-cpp2/MyServicePrioChild.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/basic-annotations/gen-cpp2/MyServicePrioChild.h
third-party/thrift/src/thrift/compiler/test/fixtures/basic-annotations/gen-cpp2/MyServicePrioParent.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/basic-annotations/gen-cpp2/MyServicePrioParent.h
third-party/thrift/src/thrift/compiler/test/fixtures/basic-stack-arguments/gen-cpp2/DbMixedStackArguments.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/basic-stack-arguments/gen-cpp2/DbMixedStackArguments.h
third-party/thrift/src/thrift/compiler/test/fixtures/basic-stack-arguments/gen-cpp2/MyService.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/basic-stack-arguments/gen-cpp2/MyService.h
third-party/thrift/src/thrift/compiler/test/fixtures/basic-structured-annotations/gen-cpp2/MyService.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/basic-structured-annotations/gen-cpp2/MyService.h
third-party/thrift/src/thrift/compiler/test/fixtures/basic/gen-cpp2/DbMixedStackArguments.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/basic/gen-cpp2/DbMixedStackArguments.h
third-party/thrift/src/thrift/compiler/test/fixtures/basic/gen-cpp2/FB303Service.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/basic/gen-cpp2/FB303Service.h
third-party/thrift/src/thrift/compiler/test/fixtures/basic/gen-cpp2/FooService.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/basic/gen-cpp2/FooService.h
third-party/thrift/src/thrift/compiler/test/fixtures/basic/gen-cpp2/MyService.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/basic/gen-cpp2/MyService.h
third-party/thrift/src/thrift/compiler/test/fixtures/coroutines/gen-cpp2/MyService.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/coroutines/gen-cpp2/MyService.h
third-party/thrift/src/thrift/compiler/test/fixtures/doctext/gen-cpp2/C.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/doctext/gen-cpp2/C.h
third-party/thrift/src/thrift/compiler/test/fixtures/exceptions/gen-cpp2/Raiser.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/exceptions/gen-cpp2/Raiser.h
third-party/thrift/src/thrift/compiler/test/fixtures/fatal/gen-cpp2/service1.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/fatal/gen-cpp2/service1.h
third-party/thrift/src/thrift/compiler/test/fixtures/fatal/gen-cpp2/service2.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/fatal/gen-cpp2/service2.h
third-party/thrift/src/thrift/compiler/test/fixtures/fatal/gen-cpp2/service3.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/fatal/gen-cpp2/service3.h
third-party/thrift/src/thrift/compiler/test/fixtures/fatal/gen-cpp2/service_with_special_names.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/fatal/gen-cpp2/service_with_special_names.h
third-party/thrift/src/thrift/compiler/test/fixtures/includes/gen-cpp2/MyService.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/includes/gen-cpp2/MyService.h
third-party/thrift/src/thrift/compiler/test/fixtures/inheritance/gen-cpp2/MyLeaf.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/inheritance/gen-cpp2/MyLeaf.h
third-party/thrift/src/thrift/compiler/test/fixtures/inheritance/gen-cpp2/MyNode.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/inheritance/gen-cpp2/MyNode.h
third-party/thrift/src/thrift/compiler/test/fixtures/inheritance/gen-cpp2/MyRoot.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/inheritance/gen-cpp2/MyRoot.h
third-party/thrift/src/thrift/compiler/test/fixtures/interactions/gen-cpp2/MyService.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/interactions/gen-cpp2/MyService.h
third-party/thrift/src/thrift/compiler/test/fixtures/mcpp2-compare/gen-cpp2/ExtraService.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/mcpp2-compare/gen-cpp2/ExtraService.h
third-party/thrift/src/thrift/compiler/test/fixtures/mcpp2-compare/gen-cpp2/ParamService.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/mcpp2-compare/gen-cpp2/ParamService.h
third-party/thrift/src/thrift/compiler/test/fixtures/mcpp2-compare/gen-cpp2/ReturnService.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/mcpp2-compare/gen-cpp2/ReturnService.h
third-party/thrift/src/thrift/compiler/test/fixtures/namespace_from_package/gen-cpp2/TestService.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/namespace_from_package/gen-cpp2/TestService.h
third-party/thrift/src/thrift/compiler/test/fixtures/namespace_from_package_without_module_name/gen-cpp2/TestService.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/namespace_from_package_without_module_name/gen-cpp2/TestService.h
third-party/thrift/src/thrift/compiler/test/fixtures/no-legacy-apis/gen-cpp2/MyService.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/no-legacy-apis/gen-cpp2/MyService.h
third-party/thrift/src/thrift/compiler/test/fixtures/no_metadata/gen-cpp2/MyService.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/no_metadata/gen-cpp2/MyService.h
third-party/thrift/src/thrift/compiler/test/fixtures/no_service_handler_coroutines/cmd [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/no_service_handler_coroutines/gen-cpp2/MyService.cpp [copied from third-party/thrift/src/thrift/compiler/test/fixtures/basic-annotations/gen-cpp2/BadService.cpp with 54% similarity]
third-party/thrift/src/thrift/compiler/test/fixtures/no_service_handler_coroutines/gen-cpp2/MyService.h [copied from third-party/thrift/src/thrift/compiler/test/fixtures/includes/gen-cpp2/MyService.h with 57% similarity]
third-party/thrift/src/thrift/compiler/test/fixtures/no_service_handler_coroutines/gen-cpp2/MyService.tcc [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/no_service_handler_coroutines/gen-cpp2/MyServiceAsyncClient.cpp [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/no_service_handler_coroutines/gen-cpp2/MyServiceAsyncClient.h [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/no_service_handler_coroutines/gen-cpp2/MyService_custom_protocol.h [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/no_service_handler_coroutines/gen-cpp2/MyService_processmap_binary.cpp [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/no_service_handler_coroutines/gen-cpp2/MyService_processmap_compact.cpp [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/no_service_handler_coroutines/gen-cpp2/module_clients.h [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/no_service_handler_coroutines/gen-cpp2/module_constants.cpp [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/no_service_handler_coroutines/gen-cpp2/module_constants.h [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/no_service_handler_coroutines/gen-cpp2/module_data.cpp [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/no_service_handler_coroutines/gen-cpp2/module_data.h [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/no_service_handler_coroutines/gen-cpp2/module_for_each_field.h [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/no_service_handler_coroutines/gen-cpp2/module_handlers.h [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/no_service_handler_coroutines/gen-cpp2/module_metadata.cpp [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/no_service_handler_coroutines/gen-cpp2/module_metadata.h [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/no_service_handler_coroutines/gen-cpp2/module_types.cpp [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/no_service_handler_coroutines/gen-cpp2/module_types.h [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/no_service_handler_coroutines/gen-cpp2/module_types.tcc [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/no_service_handler_coroutines/gen-cpp2/module_types_custom_protocol.h [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/no_service_handler_coroutines/gen-cpp2/module_visit_by_thrift_field_metadata.h [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/no_service_handler_coroutines/gen-cpp2/module_visit_union.h [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/no_service_handler_coroutines/gen-cpp2/module_visitation.h [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/no_service_handler_coroutines/src/module.thrift [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/params/gen-cpp2/NestedContainers.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/params/gen-cpp2/NestedContainers.h
third-party/thrift/src/thrift/compiler/test/fixtures/py3/gen-py3cpp/DerivedService.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/py3/gen-py3cpp/DerivedService.h
third-party/thrift/src/thrift/compiler/test/fixtures/py3/gen-py3cpp/RederivedService.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/py3/gen-py3cpp/RederivedService.h
third-party/thrift/src/thrift/compiler/test/fixtures/py3/gen-py3cpp/SimpleService.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/py3/gen-py3cpp/SimpleService.h
third-party/thrift/src/thrift/compiler/test/fixtures/single_file_service/gen-cpp2/module_handlers.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/single_file_service/gen-cpp2/module_handlers.h
third-party/thrift/src/thrift/compiler/test/fixtures/sink/gen-cpp2/SinkService.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/sink/gen-cpp2/SinkService.h
third-party/thrift/src/thrift/compiler/test/fixtures/split/gen-cpp2/DbMixedStackArguments.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/split/gen-cpp2/DbMixedStackArguments.h
third-party/thrift/src/thrift/compiler/test/fixtures/split/gen-cpp2/MyService.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/split/gen-cpp2/MyService.h
third-party/thrift/src/thrift/compiler/test/fixtures/stream/gen-cpp2/PubSubStreamingService.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/stream/gen-cpp2/PubSubStreamingService.h
third-party/thrift/src/thrift/compiler/test/fixtures/types/gen-cpp2/SomeService.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/types/gen-cpp2/SomeService.h
third-party/thrift/src/thrift/compiler/test/fixtures/visitation/gen-cpp2/service1.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/visitation/gen-cpp2/service1.h
third-party/thrift/src/thrift/compiler/test/fixtures/visitation/gen-cpp2/service2.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/visitation/gen-cpp2/service2.h
third-party/thrift/src/thrift/compiler/test/fixtures/visitation/gen-cpp2/service3.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/visitation/gen-cpp2/service3.h
third-party/thrift/src/thrift/compiler/test/fixtures/visitation/gen-cpp2/service_with_special_names.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/visitation/gen-cpp2/service_with_special_names.h