code: def defer_sync(self, func):
          
          latch = Latch()
          def wrapper():
              try:
                  latch.put(func())
              except Exception:
                  latch.put(sys.exc_info()[1])
          self.defer(wrapper)
          res = latch.get()
          if isinstance(res, Exception):
              raise res
          return res
docs: Arrange for `func()` to execute on :class:`Broker` thread, blocking the
          current thread until a result or exception is available.
  
          :returns:
              Return value of `func()`.