Remove an object from the linked list.

        Args:
            future (PlasmaObjectFuture): A PlasmaObjectFuture instance.

def remove(self, future):
        """Remove an object from the linked list.

        Args:
            future (PlasmaObjectFuture): A PlasmaObjectFuture instance.
        """
        if self._loop.get_debug():
            logger.debug("Removing %s from the linked list.", future)
        if future.prev is None:
            assert future is self.head
            self.head = future.next
            if self.head is None:
                self.tail = None
                if not self.cancelled():
                    self.set_result(None)
            else:
                self.head.prev = None
        elif future.next is None:
            assert future is self.tail
            self.tail = future.prev
            if self.tail is None:
                self.head = None
                if not self.cancelled():
                    self.set_result(None)
            else:
                self.tail.prev = None