File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,25 +12,15 @@ def __init__(
1212 iothub_connection_string ,
1313 eventhub_connection_string ,
1414 eventhub_consumer_group ,
15- event_loop = None ,
1615 executor = None ,
1716 ):
18- # Keep the passed-in loop as a fallback, but prefer the currently running loop when
19- # scheduling work so we never attach futures to a different loop than the caller.
20- self ._event_loop_override = event_loop
2117 self ._executor = executor or concurrent .futures .ThreadPoolExecutor ()
2218 self ._inner_object = ServiceHelperSync (
2319 iothub_connection_string , eventhub_connection_string , eventhub_consumer_group
2420 )
2521
26- def _get_event_loop (self ):
27- try :
28- return asyncio .get_running_loop ()
29- except RuntimeError :
30- return self ._event_loop_override or asyncio .get_event_loop ()
31-
3222 async def _run_in_executor (self , func , * args ):
33- loop = self . _get_event_loop ()
23+ loop = asyncio . get_running_loop ()
3424 return await loop .run_in_executor (self ._executor , func , * args )
3525
3626 def set_identity (self , device_id , module_id ):
Original file line number Diff line number Diff line change @@ -5,8 +5,6 @@ junit_logging=all
55junit_family =xunit2
66junit_log_passing_tests =True
77asyncio_mode =auto
8- asyncio_legacy_mode =true
9- ; asyncio_default_fixture_loop_scope = function
108addopts =
119 --testdox
1210 --force-testdox
Original file line number Diff line number Diff line change 22timeout =30
33testdox_format =plaintext
44asyncio_mode =auto
5- asyncio_legacy_mode =true
65addopts =
76 --testdox
8- --force-testdox
7+ --force-testdox
You can’t perform that action at this time.
0 commit comments