File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 99__author__ = "Michael Hall"
1010__license__ = "Apache-2.0"
1111__copyright__ = "Copyright 2020-Present Michael Hall"
12- __version__ = "2025.06.08b "
12+ __version__ = "2025.06.25b "
1313
1414import os
1515import sys
Original file line number Diff line number Diff line change 1919import asyncio
2020import concurrent .futures as cf
2121import threading
22- from collections .abc import Coroutine , Generator
22+ from collections .abc import Callable , Coroutine , Generator
2323from contextlib import contextmanager
2424
2525from . import _typings as t
@@ -139,7 +139,10 @@ def _run_forever(
139139
140140@contextmanager
141141def threaded_loop (
142- * , use_eager_task_factory : bool = True , wait_on_exit : bool = True
142+ * ,
143+ use_eager_task_factory : bool = True ,
144+ wait_on_exit : bool = True ,
145+ loop_factory : Callable [[], asyncio .AbstractEventLoop ] | None = None ,
143146) -> Generator [LoopWrapper , None , None ]:
144147 """Create and use a managed event loop in a backround thread.
145148
@@ -157,7 +160,7 @@ def threaded_loop(
157160 LoopWrapper
158161 A wrapper with methods for interacting with the background loop.
159162 """
160- loop = asyncio .new_event_loop ()
163+ loop = ( loop_factory or asyncio .new_event_loop ) ()
161164 thread = None
162165 wrapper = None
163166 try :
You can’t perform that action at this time.
0 commit comments