def read_rv(self, async_rv):
        """Return and remove asynchronous return value.
        """
        if self.ns != async_rv.ns:
            raise ValueError("Namespace mismatch")
        if (async_rv.ns in _g_async_rvs and
            async_rv.rvid in _g_async_rvs[async_rv.ns]):
            rv = _g_async_rvs[async_rv.ns][async_rv.rvid]
            if not isinstance(rv, pythonshare.InProgress):
                del _g_async_rvs[async_rv.ns][async_rv.rvid]
            return rv
        else:
            raise ValueError('Invalid return value id: "%s"'
                             % (async_rv.rvid,))