code: def wait(self, timeout=None):
          
          if self.__event.wait(timeout):
              if self.exception is not None:
                  # todo better way to raise errors on behalf of other Threads?
                  raise self.exception  # pylint: disable=raising-bad-type
              return True
          return False
docs: Wait for the request to finish, optionally timing out. Returns True if the request has finished or False if
          it is still pending.
  
          Raises [LinkException](AmqpLink.m.html#IoticAgent.Core.AmqpLink.LinkException) if the request failed due to a
          network related problem.