I'm trying to run gRPC server in Python. I found a way to do it like this:
import grpc
from concurrent import futuresserver = grpc.server(futures.ThreadPoolExecutor(max_workers=100))
... # add my grpc servicer to server
server.add_insecure_port('[::]:50051')
server.start()
I need to add some options to the server like max_send_message_length
, max_receive_message_length
, etc. There is an options
argument in grpc.server(...)
, but I can't figure out how to use it.
server = grpc.server(futures.ThreadPoolExecutor(max_workers=100), options=[???])
From gRPC documentation:
options – An optional list of key-value pairs (channel args in gRPC runtime) to configure the channel.
How do I create these options? Are they string-string pairs?
I'm new to Python and gRPC, though.