File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed
Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -366,12 +366,15 @@ def subscribe(
366366 loop = self ._loop ,
367367 )
368368
369- self ._protocol .subscribe (
369+ asyncio .run_coroutine_threadsafe (
370+ self ._subscribe_task (
370371 schema = schema ,
371372 symbols = symbols ,
372373 stype_in = stype_in ,
373374 start = start ,
374- )
375+ ),
376+ loop = self ._loop ,
377+ ).result ()
375378
376379 def resume_reading (self ) -> None :
377380 """
@@ -496,3 +499,21 @@ async def _connect_task(
496499 )
497500
498501 return transport , protocol
502+
503+ async def _subscribe_task (
504+ self ,
505+ schema : Schema | str ,
506+ symbols : Iterable [str ] | Iterable [Number ] | str | Number = ALL_SYMBOLS ,
507+ stype_in : SType | str = SType .RAW_SYMBOL ,
508+ start : str | int | None = None ,
509+ ) -> None :
510+ with self ._lock :
511+ if self ._protocol is None :
512+ return
513+
514+ self ._protocol .subscribe (
515+ schema = schema ,
516+ symbols = symbols ,
517+ stype_in = stype_in ,
518+ start = start ,
519+ )
You can’t perform that action at this time.
0 commit comments