code: def maybe_call_closing_deferred(self):
          
  
          if self._closing_deferred:
              self._closing_deferred.callback(self)
              self._closing_deferred = None
          self._when_closed.fire(self)
docs: Used internally to callback on the _closing_deferred if it
          exists.