def registerDeferred(self, event, d):
        """
        Register a defer to be fired at the firing of a specific event.

        :param string event: Currently supported values are `connect`. Another
          value may be `_dtor` which will register an event to fire when this
          object has been completely destroyed.

        :param event: The defered to fire when the event succeeds or failes
        :type event: :class:`Deferred`

        If this event has already fired, the deferred will be triggered
        asynchronously.

        Example::

          def on_connect(*args):
              print("I'm connected")
          def on_connect_err(*args):
              print("Connection failed")

          d = Deferred()
          cb.registerDeferred('connect', d)
          d.addCallback(on_connect)
          d.addErrback(on_connect_err)

        :raise: :exc:`ValueError` if the event name is unrecognized
        """
        try:
            self._evq[event].schedule(d)
        except __HOLE__:
            raise ValueError("No such event type", event)
dataset/ETHPy150Open couchbase/couchbase-python-client/txcouchbase/bucket.py/RawBucket.registerDeferred