code: def _not_forever(self, timeout, d):
          
          t = self._reactor.callLater(timeout, d.cancel)
  
          def _done(res):
              if t.active():
                  t.cancel()
              return res
  
          d.addBoth(_done)
          return d
docs: If the timer fires first, cancel the deferred. If the deferred fires
          first, cancel the timer.