public function attach($eventName, callable $handler, $priority = 0)
    {
        if (is_array($eventName)) {
            foreach ($eventName as $name) {
                $this->attach($name, $handler, $priority);
            }
            return;
        }
        if (!is_string($eventName)) {
            throw new InvalidArgumentException(sprintf(
                '%s expects argument 1 to be string; %s given.',
                __METHOD__,
                is_object($eventName) ? get_class($eventName) : gettype($eventName)
            ));
        }

        if (!array_key_exists($eventName, $this->events)) {
            $this->events[$eventName] = new CallbackQueue();
        }

        $this->events[$eventName]->add($handler, $priority);
    }