protected function removeFromQueue(
        PriorityQueueInterface $queue,
        $callabOrClassname
    ) {
        if (is_object($callabOrClassname)) {
            $queue->remove($callabOrClassname);
        } else {
            foreach ($queue as $data) {
                if (is_a($data['data'], $callabOrClassname)) {
                    $queue->remove($data['data']);
                }
            }
        }
    }