Skip to content

Commit cc6b5ad

Browse files
Rashmi Makhejafacebook-github-bot
Rashmi Makheja
authored andcommitted
Generate header methods
Summary: Internal : User post -https://fb.workplace.com/groups/thriftusers/permalink/1451667708875970/ Context: Hack Thrift Client throws away rpc headers received as part of the response from server. In c++, the common <rpc> method also throws away the headers but based on an annotation - GenerateDeprecatedHeaderClientMethods, an additional method header_<rpc> is generated that would return the headers along with response. This diff : - uses the annotation added in previous diff to generate `header_` methods. - when present, the common `<rpc>` method would call `<header_rpc>` method and discard the header. This reduces the duplicate code between the two - In addition `genAwaitResponse` is replaces with `genAwaitResponseWithHeaders`, so that we can change the `genAwaitResponse` to return headers and eventually remove `genAwaitResponseWithHeaders`. - instead of discarding headers in `genAwaitResponse`, headers will be discarded in `<rpc>`. Reviewed By: iahs Differential Revision: D70428261 fbshipit-source-id: b566e5aa73d1ca6821f4ea1e612c51856b42b382
1 parent a6afde1 commit cc6b5ad

File tree

51 files changed

+5312
-119
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+5312
-119
lines changed

third-party/thrift/src/thrift/compiler/ast/uri.h

+2
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ inline constexpr auto kHackWrapperUri =
170170
"facebook.com/thrift/annotation/hack/Wrapper";
171171
inline constexpr auto kHackModuleInternalUri =
172172
"facebook.com/thrift/annotation/hack/ModuleInternal";
173+
inline constexpr auto kHackGenerateClientMethodsWithHeaders =
174+
"facebook.com/thrift/annotation/hack/GenerateClientMethodsWithHeaders";
173175

174176
// Go:
175177
inline constexpr auto kGoNameUri = "facebook.com/thrift/annotation/go/Name";

third-party/thrift/src/thrift/compiler/generate/t_hack_generator.cc

+77-23
Original file line numberDiff line numberDiff line change
@@ -887,6 +887,11 @@ class t_hack_generator : public t_concat_generator {
887887
nullptr;
888888
}
889889

890+
bool should_generate_client_header_methods(const t_named* tnamed) const {
891+
return tnamed->find_structured_annotation_or_null(
892+
kHackGenerateClientMethodsWithHeaders) != nullptr;
893+
}
894+
890895
std::string php_namespace(const t_program* p) const {
891896
std::string php_ns = p->get_namespace("php");
892897
if (!php_ns.empty()) {
@@ -7133,6 +7138,11 @@ void t_hack_generator::_generate_service_client_child_fn(
71337138
return;
71347139
}
71357140

7141+
bool is_oneway = tfunction->qualifier() == t_function_qualifier::oneway;
7142+
bool gen_header_method = !is_oneway &&
7143+
(should_generate_client_header_methods(tfunction) ||
7144+
should_generate_client_header_methods(tservice));
7145+
bool is_void = tfunction->return_type()->is_void();
71367146
std::string funname =
71377147
find_hack_name(tfunction) + (legacy_arrays ? "__LEGACY_ARRAYS" : "");
71387148
std::string long_name = php_servicename_mangle(mangled_services_, tservice);
@@ -7144,16 +7154,44 @@ void t_hack_generator::_generate_service_client_child_fn(
71447154
type_to_typehint(tfunction->return_type().get_type());
71457155

71467156
generate_php_docstring(out, tfunction);
7147-
indent(out) << (has_hack_module_internal(tservice) ||
7148-
has_hack_module_internal(tfunction)
7149-
? "internal"
7150-
: "public")
7151-
<< " async function " << funname << "("
7152-
<< argument_list(
7153-
tfunction->params(), "", true, nullable_everything_)
7154-
<< "): Awaitable<" + return_typehint + "> {\n";
7157+
auto generate_method_decl = [&](bool is_header_method) {
7158+
indent(out) << (has_hack_module_internal(tservice) ||
7159+
has_hack_module_internal(tfunction)
7160+
? "internal"
7161+
: "public")
7162+
<< " async function " << (is_header_method ? "header_" : "")
7163+
<< funname << "("
7164+
<< argument_list(
7165+
tfunction->params(), "", true, nullable_everything_)
7166+
<< "): Awaitable<";
7167+
7168+
if (is_header_method) {
7169+
if (!is_void) {
7170+
out << "(" << return_typehint << ", ?dict<string,string>)";
7171+
} else {
7172+
out << "?dict<string,string>";
7173+
}
7174+
} else {
7175+
out << return_typehint;
7176+
}
7177+
out << "> {\n";
7178+
};
71557179

7180+
generate_method_decl(false);
71567181
indent_up();
7182+
if (gen_header_method) {
7183+
indent(out) << (!is_void ? "return (" : "") << "await $this->header_"
7184+
<< funname << "("
7185+
<< argument_list(tfunction->params(), "", false) << ")";
7186+
if (!is_void) {
7187+
out << ")[0]";
7188+
}
7189+
out << ";\n";
7190+
scope_down(out);
7191+
out << "\n";
7192+
generate_method_decl(true);
7193+
indent_up();
7194+
}
71577195

71587196
indent(out) << "$hh_frame_metadata = $this->getHHFrameMetadata();\n";
71597197
indent(out) << "if ($hh_frame_metadata !== null) {\n";
@@ -7178,24 +7216,40 @@ void t_hack_generator::_generate_service_client_child_fn(
71787216
<< "\", $args);\n";
71797217
_generate_current_seq_id(out, tservice, tfunction);
71807218

7181-
if (tfunction->qualifier() != t_function_qualifier::oneway) {
7182-
if (!tfunction->return_type()->is_void()) {
7183-
indent(out) << "return ";
7219+
if (is_oneway) {
7220+
out << indent() << "await $this->genAwaitNoResponse($rpc_options);\n";
7221+
scope_down(out);
7222+
out << "\n";
7223+
return;
7224+
}
7225+
7226+
std::string resultname = generate_function_helper_name(
7227+
tservice, tfunction, PhpFunctionNameSuffix::RESULT);
7228+
7229+
std::string rpc_call = fmt::format(
7230+
"await $this->genAwaitResponseWithReadHeaders({}::class, \"{}\", {}, $currentseqid, $rpc_options{})",
7231+
resultname,
7232+
tfunction->name(),
7233+
is_void ? "true" : "false",
7234+
legacy_arrays ? ", shape('read_options' => \\THRIFT_MARK_LEGACY_ARRAYS)"
7235+
: "");
7236+
7237+
if (gen_header_method) {
7238+
if (is_void) {
7239+
// return headers only if void
7240+
indent(out) << "return (" << rpc_call << ")[1];\n";
71847241
} else {
7185-
indent(out);
7242+
// return both response and headers
7243+
indent(out) << "return " << rpc_call << ";\n";
71867244
}
7187-
std::string resultname = generate_function_helper_name(
7188-
tservice, tfunction, PhpFunctionNameSuffix::RESULT);
7189-
bool is_void = tfunction->return_type()->is_void();
7190-
out << "await $this->genAwaitResponse(" << resultname << "::class, " << "\""
7191-
<< tfunction->name() << "\", " << (is_void ? "true" : "false")
7192-
<< ", $currentseqid, $rpc_options";
7193-
if (legacy_arrays) {
7194-
out << ", shape('read_options' => \\THRIFT_MARK_LEGACY_ARRAYS)";
7195-
}
7196-
out << ");\n";
71977245
} else {
7198-
out << indent() << "await $this->genAwaitNoResponse($rpc_options);\n";
7246+
// return nothing if void
7247+
if (is_void) {
7248+
indent(out) << rpc_call << ";\n";
7249+
} else {
7250+
// return response only
7251+
indent(out) << "return (" << rpc_call << ")[0];\n";
7252+
}
71997253
}
72007254
scope_down(out);
72017255
out << "\n";

third-party/thrift/src/thrift/compiler/test/fixtures/adapter/out/hack/gen-hack/AdapterService.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ trait AdapterServiceClientBase {
100100
$args = \facebook\thrift\test\AdapterService_count_args::withDefaultValues();
101101
await $this->asyncHandler_->genBefore(AdapterServiceStaticMetadata::THRIFT_SVC_NAME, "count", $args);
102102
$currentseqid = $this->sendImplHelper($args, "count", false, AdapterServiceStaticMetadata::THRIFT_SVC_NAME );
103-
return await $this->genAwaitResponse(\facebook\thrift\test\AdapterService_count_result::class, "count", false, $currentseqid, $rpc_options);
103+
return (await $this->genAwaitResponseWithReadHeaders(\facebook\thrift\test\AdapterService_count_result::class, "count", false, $currentseqid, $rpc_options))[0];
104104
}
105105

106106
/**
@@ -119,7 +119,7 @@ trait AdapterServiceClientBase {
119119
));
120120
await $this->asyncHandler_->genBefore(AdapterServiceStaticMetadata::THRIFT_SVC_NAME, "adaptedTypes", $args);
121121
$currentseqid = $this->sendImplHelper($args, "adaptedTypes", false, AdapterServiceStaticMetadata::THRIFT_SVC_NAME );
122-
return await $this->genAwaitResponse(\facebook\thrift\test\AdapterService_adaptedTypes_result::class, "adaptedTypes", false, $currentseqid, $rpc_options);
122+
return (await $this->genAwaitResponseWithReadHeaders(\facebook\thrift\test\AdapterService_adaptedTypes_result::class, "adaptedTypes", false, $currentseqid, $rpc_options))[0];
123123
}
124124

125125
}

third-party/thrift/src/thrift/compiler/test/fixtures/adapter/out/hack/gen-hack/Service.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ trait ServiceClientBase {
9191
));
9292
await $this->asyncHandler_->genBefore(ServiceStaticMetadata::THRIFT_SVC_NAME, "func", $args);
9393
$currentseqid = $this->sendImplHelper($args, "func", false, ServiceStaticMetadata::THRIFT_SVC_NAME );
94-
return await $this->genAwaitResponse(\facebook\thrift\test\Service_func_result::class, "func", false, $currentseqid, $rpc_options);
94+
return (await $this->genAwaitResponseWithReadHeaders(\facebook\thrift\test\Service_func_result::class, "func", false, $currentseqid, $rpc_options))[0];
9595
}
9696

9797
}

third-party/thrift/src/thrift/compiler/test/fixtures/basic-annotations/out/hack/gen-hack/BadService.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function createBadInteraction(): BadService_BadInteraction {
8080
$args = BadService_bar_args::withDefaultValues();
8181
await $this->asyncHandler_->genBefore(BadServiceStaticMetadata::THRIFT_SVC_NAME, "bar", $args);
8282
$currentseqid = $this->sendImplHelper($args, "bar", false, BadServiceStaticMetadata::THRIFT_SVC_NAME );
83-
return await $this->genAwaitResponse(BadService_bar_result::class, "bar", false, $currentseqid, $rpc_options);
83+
return (await $this->genAwaitResponseWithReadHeaders(BadService_bar_result::class, "bar", false, $currentseqid, $rpc_options))[0];
8484
}
8585

8686
}
@@ -130,7 +130,7 @@ public function __construct(\TProtocol $input, ?\TProtocol $output = null, ?\ITh
130130
$args = BadService_BadInteraction_foo_args::withDefaultValues();
131131
await $this->asyncHandler_->genBefore("BadService", "BadInteraction.foo", $args);
132132
$currentseqid = $this->sendImpl_foo();
133-
await $this->genAwaitResponse(BadService_BadInteraction_foo_result::class, "foo", true, $currentseqid, $rpc_options);
133+
await $this->genAwaitResponseWithReadHeaders(BadService_BadInteraction_foo_result::class, "foo", true, $currentseqid, $rpc_options);
134134
}
135135

136136
protected function sendImpl_foo(): int {

third-party/thrift/src/thrift/compiler/test/fixtures/basic-annotations/out/hack/gen-hack/FooBarBazService.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ trait FooBarBazServiceClientBase {
115115
$args = FooBarBazService_foo_args::withDefaultValues();
116116
await $this->asyncHandler_->genBefore(FooBarBazServiceStaticMetadata::THRIFT_SVC_NAME, "foo", $args);
117117
$currentseqid = $this->sendImplHelper($args, "foo", false, FooBarBazServiceStaticMetadata::THRIFT_SVC_NAME );
118-
await $this->genAwaitResponse(FooBarBazService_foo_result::class, "foo", true, $currentseqid, $rpc_options);
118+
await $this->genAwaitResponseWithReadHeaders(FooBarBazService_foo_result::class, "foo", true, $currentseqid, $rpc_options);
119119
}
120120

121121
/**
@@ -132,7 +132,7 @@ trait FooBarBazServiceClientBase {
132132
$args = FooBarBazService_bar_args::withDefaultValues();
133133
await $this->asyncHandler_->genBefore(FooBarBazServiceStaticMetadata::THRIFT_SVC_NAME, "bar", $args);
134134
$currentseqid = $this->sendImplHelper($args, "bar", false, FooBarBazServiceStaticMetadata::THRIFT_SVC_NAME );
135-
await $this->genAwaitResponse(FooBarBazService_bar_result::class, "bar", true, $currentseqid, $rpc_options);
135+
await $this->genAwaitResponseWithReadHeaders(FooBarBazService_bar_result::class, "bar", true, $currentseqid, $rpc_options);
136136
}
137137

138138
/**
@@ -149,7 +149,7 @@ trait FooBarBazServiceClientBase {
149149
$args = FooBarBazService_baz_args::withDefaultValues();
150150
await $this->asyncHandler_->genBefore(FooBarBazServiceStaticMetadata::THRIFT_SVC_NAME, "baz", $args);
151151
$currentseqid = $this->sendImplHelper($args, "baz", false, FooBarBazServiceStaticMetadata::THRIFT_SVC_NAME );
152-
await $this->genAwaitResponse(FooBarBazService_baz_result::class, "baz", true, $currentseqid, $rpc_options);
152+
await $this->genAwaitResponseWithReadHeaders(FooBarBazService_baz_result::class, "baz", true, $currentseqid, $rpc_options);
153153
}
154154

155155
}

third-party/thrift/src/thrift/compiler/test/fixtures/basic-annotations/out/hack/gen-hack/MyService.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ trait MyServiceClientBase {
209209
$args = MyService_ping_args::withDefaultValues();
210210
await $this->asyncHandler_->genBefore(MyServiceStaticMetadata::THRIFT_SVC_NAME, "ping", $args);
211211
$currentseqid = $this->sendImplHelper($args, "ping", false, MyServiceStaticMetadata::THRIFT_SVC_NAME );
212-
await $this->genAwaitResponse(MyService_ping_result::class, "ping", true, $currentseqid, $rpc_options);
212+
await $this->genAwaitResponseWithReadHeaders(MyService_ping_result::class, "ping", true, $currentseqid, $rpc_options);
213213
}
214214

215215
/**
@@ -226,7 +226,7 @@ trait MyServiceClientBase {
226226
$args = MyService_getRandomData_args::withDefaultValues();
227227
await $this->asyncHandler_->genBefore(MyServiceStaticMetadata::THRIFT_SVC_NAME, "getRandomData", $args);
228228
$currentseqid = $this->sendImplHelper($args, "getRandomData", false, MyServiceStaticMetadata::THRIFT_SVC_NAME );
229-
return await $this->genAwaitResponse(MyService_getRandomData_result::class, "getRandomData", false, $currentseqid, $rpc_options);
229+
return (await $this->genAwaitResponseWithReadHeaders(MyService_getRandomData_result::class, "getRandomData", false, $currentseqid, $rpc_options))[0];
230230
}
231231

232232
/**
@@ -245,7 +245,7 @@ trait MyServiceClientBase {
245245
));
246246
await $this->asyncHandler_->genBefore(MyServiceStaticMetadata::THRIFT_SVC_NAME, "hasDataById", $args);
247247
$currentseqid = $this->sendImplHelper($args, "hasDataById", false, MyServiceStaticMetadata::THRIFT_SVC_NAME );
248-
return await $this->genAwaitResponse(MyService_hasDataById_result::class, "hasDataById", false, $currentseqid, $rpc_options);
248+
return (await $this->genAwaitResponseWithReadHeaders(MyService_hasDataById_result::class, "hasDataById", false, $currentseqid, $rpc_options))[0];
249249
}
250250

251251
/**
@@ -264,7 +264,7 @@ trait MyServiceClientBase {
264264
));
265265
await $this->asyncHandler_->genBefore(MyServiceStaticMetadata::THRIFT_SVC_NAME, "getDataById", $args);
266266
$currentseqid = $this->sendImplHelper($args, "getDataById", false, MyServiceStaticMetadata::THRIFT_SVC_NAME );
267-
return await $this->genAwaitResponse(MyService_getDataById_result::class, "getDataById", false, $currentseqid, $rpc_options);
267+
return (await $this->genAwaitResponseWithReadHeaders(MyService_getDataById_result::class, "getDataById", false, $currentseqid, $rpc_options))[0];
268268
}
269269

270270
/**
@@ -285,7 +285,7 @@ trait MyServiceClientBase {
285285
));
286286
await $this->asyncHandler_->genBefore(MyServiceStaticMetadata::THRIFT_SVC_NAME, "putDataById", $args);
287287
$currentseqid = $this->sendImplHelper($args, "putDataById", false, MyServiceStaticMetadata::THRIFT_SVC_NAME );
288-
await $this->genAwaitResponse(MyService_putDataById_result::class, "putDataById", true, $currentseqid, $rpc_options);
288+
await $this->genAwaitResponseWithReadHeaders(MyService_putDataById_result::class, "putDataById", true, $currentseqid, $rpc_options);
289289
}
290290

291291
/**
@@ -323,7 +323,7 @@ trait MyServiceClientBase {
323323
$args = MyService_doNothing_args::withDefaultValues();
324324
await $this->asyncHandler_->genBefore(MyServiceStaticMetadata::THRIFT_SVC_NAME, "doNothing", $args);
325325
$currentseqid = $this->sendImplHelper($args, "doNothing", false, MyServiceStaticMetadata::THRIFT_SVC_NAME );
326-
await $this->genAwaitResponse(MyService_doNothing_result::class, "doNothing", true, $currentseqid, $rpc_options);
326+
await $this->genAwaitResponseWithReadHeaders(MyService_doNothing_result::class, "doNothing", true, $currentseqid, $rpc_options);
327327
}
328328

329329
}

third-party/thrift/src/thrift/compiler/test/fixtures/basic-annotations/out/hack/gen-hack/MyServicePrioChild.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ trait MyServicePrioChildClientBase {
7373
$args = MyServicePrioChild_pang_args::withDefaultValues();
7474
await $this->asyncHandler_->genBefore(MyServicePrioChildStaticMetadata::THRIFT_SVC_NAME, "pang", $args);
7575
$currentseqid = $this->sendImplHelper($args, "pang", false, MyServicePrioChildStaticMetadata::THRIFT_SVC_NAME );
76-
await $this->genAwaitResponse(MyServicePrioChild_pang_result::class, "pang", true, $currentseqid, $rpc_options);
76+
await $this->genAwaitResponseWithReadHeaders(MyServicePrioChild_pang_result::class, "pang", true, $currentseqid, $rpc_options);
7777
}
7878

7979
}

third-party/thrift/src/thrift/compiler/test/fixtures/basic-annotations/out/hack/gen-hack/MyServicePrioParent.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ trait MyServicePrioParentClientBase {
9494
$args = MyServicePrioParent_ping_args::withDefaultValues();
9595
await $this->asyncHandler_->genBefore(MyServicePrioParentStaticMetadata::THRIFT_SVC_NAME, "ping", $args);
9696
$currentseqid = $this->sendImplHelper($args, "ping", false, MyServicePrioParentStaticMetadata::THRIFT_SVC_NAME );
97-
await $this->genAwaitResponse(MyServicePrioParent_ping_result::class, "ping", true, $currentseqid, $rpc_options);
97+
await $this->genAwaitResponseWithReadHeaders(MyServicePrioParent_ping_result::class, "ping", true, $currentseqid, $rpc_options);
9898
}
9999

100100
/**
@@ -111,7 +111,7 @@ trait MyServicePrioParentClientBase {
111111
$args = MyServicePrioParent_pong_args::withDefaultValues();
112112
await $this->asyncHandler_->genBefore(MyServicePrioParentStaticMetadata::THRIFT_SVC_NAME, "pong", $args);
113113
$currentseqid = $this->sendImplHelper($args, "pong", false, MyServicePrioParentStaticMetadata::THRIFT_SVC_NAME );
114-
await $this->genAwaitResponse(MyServicePrioParent_pong_result::class, "pong", true, $currentseqid, $rpc_options);
114+
await $this->genAwaitResponseWithReadHeaders(MyServicePrioParent_pong_result::class, "pong", true, $currentseqid, $rpc_options);
115115
}
116116

117117
}

third-party/thrift/src/thrift/compiler/test/fixtures/basic-structured-annotations/out/hack/gen-hack/MyService.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ trait MyServiceClientBase {
100100
$args = \test\fixtures\basic-structured-annotations\MyService_first_args::withDefaultValues();
101101
await $this->asyncHandler_->genBefore(MyServiceStaticMetadata::THRIFT_SVC_NAME, "first", $args);
102102
$currentseqid = $this->sendImplHelper($args, "first", false, MyServiceStaticMetadata::THRIFT_SVC_NAME );
103-
return await $this->genAwaitResponse(\test\fixtures\basic-structured-annotations\MyService_first_result::class, "first", false, $currentseqid, $rpc_options);
103+
return (await $this->genAwaitResponseWithReadHeaders(\test\fixtures\basic-structured-annotations\MyService_first_result::class, "first", false, $currentseqid, $rpc_options))[0];
104104
}
105105

106106
/**
@@ -119,7 +119,7 @@ trait MyServiceClientBase {
119119
));
120120
await $this->asyncHandler_->genBefore(MyServiceStaticMetadata::THRIFT_SVC_NAME, "second", $args);
121121
$currentseqid = $this->sendImplHelper($args, "second", false, MyServiceStaticMetadata::THRIFT_SVC_NAME );
122-
return await $this->genAwaitResponse(\test\fixtures\basic-structured-annotations\MyService_second_result::class, "second", false, $currentseqid, $rpc_options);
122+
return (await $this->genAwaitResponseWithReadHeaders(\test\fixtures\basic-structured-annotations\MyService_second_result::class, "second", false, $currentseqid, $rpc_options))[0];
123123
}
124124

125125
}

third-party/thrift/src/thrift/compiler/test/fixtures/basic/out/hack/gen-hack/DbMixedStackArguments.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function getDataByKey1(string $key): Awaitable<string>;
103103
));
104104
await $this->asyncHandler_->genBefore(DbMixedStackArgumentsStaticMetadata::THRIFT_SVC_NAME, "getDataByKey0", $args);
105105
$currentseqid = $this->sendImplHelper($args, "getDataByKey0", false, DbMixedStackArgumentsStaticMetadata::THRIFT_SVC_NAME );
106-
return await $this->genAwaitResponse(\test\fixtures\basic\DbMixedStackArguments_getDataByKey0_result::class, "getDataByKey0", false, $currentseqid, $rpc_options);
106+
return (await $this->genAwaitResponseWithReadHeaders(\test\fixtures\basic\DbMixedStackArguments_getDataByKey0_result::class, "getDataByKey0", false, $currentseqid, $rpc_options))[0];
107107
}
108108

109109
/**
@@ -122,7 +122,7 @@ public function getDataByKey1(string $key): Awaitable<string>;
122122
));
123123
await $this->asyncHandler_->genBefore(DbMixedStackArgumentsStaticMetadata::THRIFT_SVC_NAME, "getDataByKey1", $args);
124124
$currentseqid = $this->sendImplHelper($args, "getDataByKey1", false, DbMixedStackArgumentsStaticMetadata::THRIFT_SVC_NAME );
125-
return await $this->genAwaitResponse(\test\fixtures\basic\DbMixedStackArguments_getDataByKey1_result::class, "getDataByKey1", false, $currentseqid, $rpc_options);
125+
return (await $this->genAwaitResponseWithReadHeaders(\test\fixtures\basic\DbMixedStackArguments_getDataByKey1_result::class, "getDataByKey1", false, $currentseqid, $rpc_options))[0];
126126
}
127127

128128
}

third-party/thrift/src/thrift/compiler/test/fixtures/basic/out/hack/gen-hack/FB303Service.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function renamed_rpc(int $renamed_parameter): Awaitable<\test\fixtures\ba
8282
));
8383
await $this->asyncHandler_->genBefore(FB303ServiceStaticMetadata::THRIFT_SVC_NAME, "renamed_rpc", $args);
8484
$currentseqid = $this->sendImplHelper($args, "renamed_rpc", false, FB303ServiceStaticMetadata::THRIFT_SVC_NAME );
85-
return await $this->genAwaitResponse(\test\fixtures\basic\FB303Service_renamed_rpc_result::class, "simple_rpc", false, $currentseqid, $rpc_options);
85+
return (await $this->genAwaitResponseWithReadHeaders(\test\fixtures\basic\FB303Service_renamed_rpc_result::class, "simple_rpc", false, $currentseqid, $rpc_options))[0];
8686
}
8787

8888
}

0 commit comments

Comments
 (0)