403Webshell
Server IP : 185.252.147.100  /  Your IP : 216.73.217.33
Web Server : nginx/1.27.3
System : Linux mitrofanov.ru 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1 (2025-05-22) x86_64
User : mitr ( 1000)
PHP Version : 8.2.29
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /www/html/kanboard/app/Core/Queue/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/html/kanboard/app/Core/Queue/QueueManager.php
<?php

namespace Kanboard\Core\Queue;

use Kanboard\Core\Base;
use Kanboard\Job\BaseJob;
use LogicException;
use SimpleQueue\Queue;

/**
 * Class QueueManager
 *
 * @package Kanboard\Core\Queue
 * @author  Frederic Guillot
 */
class QueueManager extends Base
{
    /**
     * @var Queue
     */
    protected $queue = null;

    /**
     * Set queue driver
     *
     * @access public
     * @param  Queue $queue
     * @return $this
     */
    public function setQueue(Queue $queue)
    {
        $this->queue = $queue;
        return $this;
    }

    /**
     * Send a new job to the queue
     *
     * @access public
     * @param  BaseJob $job
     * @return $this
     */
    public function push(BaseJob $job)
    {
        $jobClassName = get_class($job);

        if ($this->queue !== null) {
            $this->logger->debug(__METHOD__.': Job pushed in queue: '.$jobClassName);
            $this->queue->push(JobHandler::getInstance($this->container)->serializeJob($job));
        } else {
            $this->logger->debug(__METHOD__.': Job executed synchronously: '.$jobClassName);
            call_user_func_array(array($job, 'execute'), $job->getJobParams());
        }

        return $this;
    }

    /**
     * Wait for new jobs
     *
     * @access public
     * @throws LogicException
     */
    public function listen()
    {
        if ($this->queue === null) {
            throw new LogicException('No queue driver defined or unable to connect to broker!');
        }

        while ($job = $this->queue->pull()) {
            JobHandler::getInstance($this->container)->executeJob($job);
            $this->queue->completed($job);
        }
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit