File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 77
88#### Bug fixes
99- Fixed an issue receiving multiple DBN v1 ` ErrorMsg ` in the ` Live ` client would cause an ` InvalidState ` error
10+ - Fixed an issue where creating ` Live ` clients in multiple threads could cause a ` RuntimeError ` upon initialization
1011
1112## 0.39.2 - 2024-08-13
1213
Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ class Live:
6161 """
6262
6363 _loop = asyncio .new_event_loop ()
64+ _lock = threading .Lock ()
6465 _thread = threading .Thread (
6566 target = _loop .run_forever ,
6667 name = "databento_live" ,
@@ -109,8 +110,9 @@ def __init__(
109110
110111 self ._session ._user_callbacks .append ((self ._map_symbol , None ))
111112
112- if not Live ._thread .is_alive ():
113- Live ._thread .start ()
113+ with Live ._lock :
114+ if not Live ._thread .is_alive ():
115+ Live ._thread .start ()
114116
115117 def __del__ (self ) -> None :
116118 try :
You can’t perform that action at this time.
0 commit comments