Closed boylegu closed 4 years ago
Hi! With multiprocessing we cannot correctly pass context_manager
and setup_fn
parameters to Server.add_service
if they allocate system resources (connections to databases, for example). On Linux, you can run multiple instances of your server on the same port with SO_REUSEPORT
option, this will effectively load balance the traffic on TCP connection level, if this is what you want. I will be updating example code shortly.
oh~ Thanks a lot!
My code:
Exception: TypeError: init() got an unexpected keyword argument 'num_processes'
I don't understand why your example code is shown as if good.
Could you tell me why?
environment: purerpc==0.5.2 python == 3.6