code: def waitForResponse(self, timeOut=None):
          
          self.__evt.wait(timeOut)
          if self.waiting():
              raise Timeout()
          else:
              if self.response["error"]:
                  raise Exception(self.response["error"])
              else:
                  return self.response["result"]
docs: blocks until the response arrived or timeout is reached.