6#include <grpcpp/channel.h>
7#include <grpcpp/completion_queue.h>
8#include <grpcpp/security/credentials.h>
10#include <userver/engine/deadline.hpp>
11#include <userver/engine/task/task_processor_fwd.hpp>
13#include <userver/ugrpc/client/impl/client_data.hpp>
15USERVER_NAMESPACE_BEGIN
21[[nodiscard]]
bool TryWaitForConnected(
22 grpc::Channel& channel, grpc::CompletionQueue& queue,
23 engine::Deadline deadline, engine::TaskProcessor& blocking_task_processor);
25[[nodiscard]]
bool TryWaitForConnected(
26 impl::ChannelCache::Token& token, grpc::CompletionQueue& queue,
27 engine::Deadline deadline, engine::TaskProcessor& blocking_task_processor);
44 engine::TaskProcessor& blocking_task_processor,
45 std::shared_ptr<grpc::ChannelCredentials> channel_credentials,
46 const std::string& endpoint);
53template <
typename Client>
55 Client& client, engine::Deadline deadline,
56 engine::TaskProcessor& blocking_task_processor) {
57 return impl::TryWaitForConnected(
58 impl::GetClientData(client).GetChannelToken(),
59 impl::GetClientData(client).NextQueue(), deadline,
60 blocking_task_processor);