public function add($listener, $priority)
    {
        if (!$this->storage->contains($listener)) {
            // Compute the internal priority as an array.
            $priority = [$priority, $this->counter--];

            $this->storage->attach($listener, $priority);
            $this->queue->insert($listener, $priority);
        }

        return $this;
    }