According the documentation, a gRPC client is created from a channel. Multiple concrete gRPC clients can be created from a channel, including different types of clients, but I didn't find any information about concurrency.
So, my question, Can I use the channel for concurrent calls like below?
var channel = GrpcChannel.ForAddress("https://localhost:5001");
// the first task
Task.Run(() => {
var client = new Greet.GreeterClient(channel);
var response = await client.SayHelloAsync(new HelloRequest { Name = "World" });
Console.WriteLine("Greeting: " + response.Message);
});
// the second task
Task.Run(() => {
var client = new Greet.GreeterClient(channel);
var response = await client.SayHelloAsync(new HelloRequest { Name = "World" });
Console.WriteLine("Greeting: " + response.Message);
});
Or I need to create own channel for each thread(task).