Python's gRPC implementation allows for consumers to specify a channel when creating clients, like so:
def run():
channel = grpc.insecure_channel('localhost:50051')
my_stub = helloworld_pb2_grpc.FirstStub(channel)
my_other_stub = helloworld_pb2_grpc.SomeOtherStub(channel)
...
The Objective-C implementation uses a singleton channel, where the current Swift implementation creates a new one every time.
Ideally, consumers would be able to specify their own Channel between multiple clients, which would alleviate the need for creating a new one each time:
/// Create a client with a pre-defined channel.
public init(channel: Channel) {
gRPC.initialize()
self.channel = channel
self.metadata = Metadata()
}