@@ -44,15 +44,15 @@ def __init__(self, address, key):
4444 global comms
4545 comms = self
4646
47- def send_data_to_bg_process (self , action , obj , receive = False ):
47+ def send_data_to_bg_process (self , action , obj , receive = False , timeout_in_sec = 0.1 ):
4848 """Try-catched send_data_to_bg_process"""
4949 try :
50- return self ._send_data_to_bg_process (action , obj , receive )
50+ return self ._send_data_to_bg_process (action , obj , receive , timeout_in_sec )
5151 except Exception as e :
5252 logger .debug ("Exception happened in send_data_to_bg_process : %s" , e )
5353 return {"success" : False , "error" : "unknown" }
5454
55- def _send_data_to_bg_process (self , action , obj , receive = False ):
55+ def _send_data_to_bg_process (self , action , obj , receive = False , timeout_in_sec = 0.1 ):
5656 """
5757 This creates a new client for comms to the background process
5858 """
@@ -88,7 +88,7 @@ def target(address, key, receive, data, result_obj):
8888
8989 # Start and join the thread for 100ms, afterwards the thread is forced to close (daemon=True)
9090 t .start ()
91- t .join (timeout = 0.1 )
91+ t .join (timeout = timeout_in_sec )
9292 if not result_obj [0 ]:
9393 logger .debug (
9494 " Failure in communication to background process, %s(%s)" , action , obj
0 commit comments