✏️ 正在编辑: runners.cpython-312.pyc
路径:
/lib64/python3.12/asyncio/__pycache__/runners.cpython-312.pyc
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
� �֦i> � � � d Z ddlZddlZddlZddlZddlZddlmZ ddlmZ ddlm Z ddlm Z ddlmZ G d � d ej � Z G d� d� Zddd �d�Zd� Zy))�Runner�run� N� )� coroutines)�events)� exceptions)�tasks)� constantsc � � e Zd ZdZdZdZy)�_State�created�initialized�closedN)�__name__� __module__�__qualname__�CREATED�INITIALIZED�CLOSED� � �(/usr/lib64/python3.12/asyncio/runners.pyr r s � ��G��K� �Fr r c �N � e Zd ZdZddd�d�Zd� Zd� Zd� Zd� Zdd �d �Z d� Z d� Zy) r a5 A context manager that controls event loop life cycle. The context manager always creates a new event loop, allows to run async functions inside it, and properly finalizes the loop at the context manager exit. If debug is True, the event loop will be run in debug mode. If loop_factory is passed, it is used for new event loop creation. asyncio.run(main(), debug=True) is a shortcut for with asyncio.Runner(debug=True) as runner: runner.run(main()) The run() method can be called multiple times within the runner's context. This can be useful for interactive console (e.g. IPython), unittest runners, console tools, -- everywhere when async code is called from existing sync framework and where the preferred single asyncio.run() call doesn't work. N��debug�loop_factoryc � � t j | _ || _ || _ d | _ d | _ d| _ d| _ y )Nr F) r r �_state�_debug� _loop_factory�_loop�_context�_interrupt_count�_set_event_loop)�selfr r s r �__init__zRunner.__init__0 s: � ��n�n������)����� ��� � !���$��r c �&