public function attach(string $eventName, $handler, int $priority = 100): void
    {
        if (is_object($handler) == false && is_callable($handler) == false) {
            throw new InvalidArgumentException(
                sprintf('Event handler must be either an object or a callable %s given.', gettype($handler))
            );
        }

        $priorityQueue = $this->fetchQueue($eventName);
        $priorityQueue->insert($handler, $priority);
    }