File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
hkube_python_wrapper/communication/streaming Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1+ import threading
12import time
23from hkube_python_wrapper .util .DaemonThread import DaemonThread
34
@@ -8,15 +9,19 @@ def __init__(self, messageListeners):
89 self ._working = True
910 self ._messageListeners = messageListeners
1011 DaemonThread .__init__ (self , "StreamingListener" )
11-
12+ def fetch (self ,messageListener ):
13+ messageListener .fetch ()
1214 def run (self ):
1315 while (self ._listeningToMessages ):
1416 messageListeners = self ._messageListeners ()
1517 if (not messageListeners ):
1618 time .sleep (1 ) # free some cpu
1719 continue
1820 for listener in messageListeners :
19- listener .fetch ()
21+ listener .thread = threading .Thread (target = self .fetch , args = [listener ])
22+ listener .thread .start ()
23+ for listener in messageListeners :
24+ listener .thread .join ()
2025 self ._working = False
2126
2227 def stop (self , force = True ):
You can’t perform that action at this time.
0 commit comments