def main(): # 使用静态的代码,看起来脏一点,但是类型限定更加直接 from account_service.AccountService import Processor processor = Processor(AccountProcessor()) s = Server(processor, pool_size=5, mode_ppworker=False, profile=True) s.bind("tcp://127.0.0.1:10004") s.run()
def main(): # 使用静态的代码,看起来脏一点,但是类型限定更加直接 from account_service.AccountService import Processor processor = Processor(AccountProcessor()) config = parse_config(RPC_DEFAULT_CONFIG) endpoint = config[RPC_BACK_ADDRESS] service = config[RPC_SERVICE] worker_pool_size = int(config[RPC_WORKER_POOL_SIZE]) print "Load Balance Backend Addr: ", endpoint s = Server(processor, pool_size=worker_pool_size, service=service, mode_ppworker=True) s.connect(endpoint) s.run()