Skip to content

Commit eb59346

Browse files
authored
impl(rust): custom polling policies for gRPC (#1688)
Part of the work for googleapis/google-cloud-rust#2863 Override the default polling policy in the gRPC transport stub, actually taking into account the provided `RequestOptions` and gRPC client options.
1 parent 9b55ba7 commit eb59346

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

internal/sidekick/internal/rust/templates/grpc-client/transport.rs.mustache

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,21 @@ impl super::stub::{{Codec.Name}} for {{Codec.Name}} {
161161
}
162162

163163
{{/Codec.Methods}}
164+
{{#Codec.HasLROs}}
165+
fn get_polling_error_policy(
166+
&self,
167+
options: &gax::options::RequestOptions,
168+
) -> std::sync::Arc<dyn gax::polling_error_policy::PollingErrorPolicy> {
169+
self.inner.get_polling_error_policy(options)
170+
}
171+
172+
fn get_polling_backoff_policy(
173+
&self,
174+
options: &gax::options::RequestOptions,
175+
) -> std::sync::Arc<dyn gax::polling_backoff_policy::PollingBackoffPolicy> {
176+
self.inner.get_polling_backoff_policy(options)
177+
}
178+
{{/Codec.HasLROs}}
164179
}
165180

166181
{{/Codec.Services}}

0 commit comments

Comments
 (0)