本文整理汇总了Python中Server.Server.run_server方法的典型用法代码示例。如果您正苦于以下问题:Python Server.run_server方法的具体用法?Python Server.run_server怎么用?Python Server.run_server使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Server
的用法示例。
在下文中一共展示了Server.run_server方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: print
# 需要导入模块: from Server import Server [as 别名]
# 或者: from Server.Server import run_server [as 别名]
print(3)
yield task1
task2[5] = min_const
success, (task1, task2) = dts_solver.crusher_impl(*task2)
print(4)
def answer_reducer(task_intermediate_answer):
nonlocal min_const
nonlocal min_solutions_jumps
cost = task_intermediate_answer.cost
jumps = task_intermediate_answer.jumps
if cost < min_const:
min_const = cost
min_solutions_jumps = jumps
logger.info('[answer_reducer] New cost of task is {}'.format(min_const))
def final_answer():
return min_const, min_solutions_jumps
return generate_new_task, answer_reducer, final_answer
def worker_task_handler(x):
return dts_solver.solve_impl(*x)
server = Server.run_server(
frontend_server_connection_info=('127.0.0.1', 6000),
frontend_server_callback_factory=frontend_callbacks_factory,
task_solver_func_factory=average_task_solver_functions_factory,
worker_task_handler=worker_task_handler,
log=logger
)