Set the priority of a command handler

@param  CommandHandlerInterface $handler   A command handler
@param integer                   $priority  The command priority
@return CommandChain
486075
public function setHandlerPriority(CommandHandlerInterface $handler, $priority)
    {
        $this->__queue->setPriority($handler, $priority);
        return $this;
    }
1243143
public function attach($eventType, $handler, $priority = 100)
    {
        if (!isset($this->listeners[$eventType])) {
            if ($this->enablePriorities) {
                $priorityQueue = new PriorityQueue();
                $priorityQueue->setExtractFlags(PriorityQueue::EXTR_DATA);
            } else {
                $priorityQueue = [];
            }

            $this->listeners[$eventType] = $priorityQueue;
        }

        if (is_object($this->listeners[$eventType])) {
            /** @var PriorityQueue $priorityQueue */
            $priorityQueue = &$this->listeners[$eventType];
            $priorityQueue->insert($handler, $priority);
        } else {
            $this->listeners[$eventType][] = $handler;
        }
    }
1009451
public function setPriorityString($priority)
    {
        $priority = \array_search(\strtolower($priority), TicketMessageInterface::PRIORITIES);

        if ($priority > 0) {
            $this->setPriority($priority);
        }

        return $this;
    }
375972
public function attach(ChainEventInterface $event, $priority = 0)
    {
        $this->queue->insert($event, $priority);
        return $this;
    }
329038
final public function setSuccessor(CharacterHandler $handler)
    {
        $this->successor = $handler;
        $this->successor->setPrevious($this);
    }
1198540
function(handler, priority) {
        if(typeof handler !== 'function') {
          throw new Error('Middleware must be a function.');
        }

        if(typeof priority !== 'undefined') handler.priority = priority;
        _layerList.push(handler);
        return _inst;
      }
733543
public function addSection(PipeInterface $handler, int $priority = 0): PipelineBuilder
    {
        $this->pipeline->insert($handler, $priority);
        $this->pipesCount++;
        return $this;
    }
1001388
public function setEventPriority($name, AnObjectHandable $listener, $priority)
    {
        if (isset($this->_listeners[$name])) {
            $this->_listeners[$name]->setPriority($listener, $priority);
        }
        
        return $this;
    }
15829
public function setPriority(AnObjectHandlable $object, $priority)
    {
        if ($handle = $object->getHandle()) {
            if ($this->_priority_list->offsetExists($handle)) {
                $this->_priority_list->offsetSet($handle, $priority);
                $this->_priority_list->asort();
            }
        }

        return $this;
    }
98556
public function handle(string $pattern, callable $resolver, int $priority = 0): Route
    {
        $this->cache = [];
        return $this->collection->createRoute($pattern, $resolver)->set('priority', $priority);
    }
533635
public function bindHandler($commandName, $handler)
    {
        // If the $handler given is an instance of CommandHandler, simply bind that
        if ($handler instanceof CommandHandler) {
            $this->handlers[$commandName] = $handler;
            return;
        }

        // If the handler given is callable, wrap it up in a CallableCommandHandler for executing later
        if (is_callable($handler)) {
            return $this->bindHandler($commandName, new CallableCommandHandler($handler));
        }

        // If the handler given is a string, wrap it up in a LazyLoadingCommandHandler for loading later
        if (is_string($handler)) {
            return $this->bindHandler($commandName, new LazyLoadingCommandHandler($handler, $this->container));
        }

        throw new \InvalidArgumentException('Could not push handler. Command Handlers should be an
            instance of Chief\CommandHandler, a callable, or a string representing a CommandHandler class');
    }
702967
public function pushHandler(HandlerInterface $handler)
    {
        array_unshift($this->handlers, $handler);
        if ($this->_startTime === null) {
            $this->_startTime = microtime(true);
            $this->_previousRecordTime = $this->_startTime;
        }
    }
1162035
public function addHandler(KCommandHandlerInterface $handler)
    {
        $this->__queue->enqueue($handler, $handler->getPriority());
        return $this;
    }
1099760
public function dispatchNow($command, $handler = null)
    {
        if ($handler || $handler = $this->getCommandHandler($command)) {
            $callback = function ($command) use ($handler) {
                return $handler->handle($command);
            };
        } else {
            $callback = function ($command) {
                return $this->container->call([$command, 'handle']);
            };
        }

        return $this->pipeline->send($command)->through($this->pipes)->then($callback);
    }
726437
public function handle(Delay\ManageInterface $handler)
    {
        return $handler->base($this->base, $this->product, $this->getValue());
    }
317092
function(handler, priority) {
        if(handler && handler.constructor === Array) {
          handler.forEach(function(layer) {
            layer.priority = typeof layer.priority === 'undefined' ? 1 : layer.priority;
          });
          _list = _list.concat(handler);
        } else {
          handler.priority = priority || (typeof handler.priority === 'undefined' ? 1 : handler.priority);
          _list.push(handler);
        }
        return this;
      }
168969
public function setPriority($priority)
    {
        self::writeFullTag(
            $priority,
            'priority',
            false,
            'priority',
            $this->validator,
            'validatePriority',
            $this->exception,
            'Provided priority is not a valid value.'
        );

        return $this;
    }