'Observe the underlying deferred.
Can return either a deferred if the underlying deferred is still pending
(or has failed), or the actual value. Callers may need to use maybeDeferred.'

def observe(self):

    if (not self._result):
        d = defer.Deferred()
        def remove(r):
            self._observers.discard(d)
            return r
        d.addBoth(remove)
        self._observers.add(d)
        return d
    else:
        (success, res) = self._result
        return (res if success else defer.fail(res))
