Exemplo n.º 1
0
        public void Start()
        {
            _logger.LogInformation("Starting the Grpc channel...");

            _channel      = GrpcChannel.ForAddress(_options.ServiceAddress, _options.ChannelOptions);
            _searchClient = new GrpcSearchClient(_channel);
        }
Exemplo n.º 2
0
        public GrpcServiceClient(GrpcSearchClient searchClient, GrpcChannel channel, GrpcChannelOptions options)
        {
            _options = new GrpcClientOptions
            {
                ChannelOptions = options,
                ServiceAddress = channel.Target
            };
            _searchClient = searchClient;
            _logger       = options?.LoggerFactory?.CreateLogger <GrpcServiceClient>() ?? NullLogger <GrpcServiceClient> .Instance;

            // we pin this object only to be able to shut it down properly later
            _channel = channel;
        }