()
| 312 | loop.run_forever() |
| 313 | |
| 314 | def get_telethon_loop(): |
| 315 | global telethon_loop, _telethon_thread |
| 316 | if telethon_loop is not None and _telethon_thread is not None and _telethon_thread.is_alive(): |
| 317 | return telethon_loop |
| 318 | with _telethon_loop_lock: |
| 319 | if telethon_loop is None or _telethon_thread is None or not _telethon_thread.is_alive(): |
| 320 | telethon_loop = asyncio.new_event_loop() |
| 321 | _telethon_thread = threading.Thread( |
| 322 | target=_start_background_loop, |
| 323 | args=(telethon_loop,), |
| 324 | daemon=True |
| 325 | ) |
| 326 | _telethon_thread.start() |
| 327 | return telethon_loop |
| 328 | |
| 329 | def run_async(coro): |
| 330 | loop = get_telethon_loop() |
no outgoing calls
no test coverage detected