PHP Класс Disque\Queue\Queue

Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$client Disque\Client Client
$name string Name

Открытые методы

Метод Описание
__construct ( Client $client, string $name ) Create a queue
failed ( Disque\Queue\JobInterface $job ) : void Marks the job as failed and returns it to the queue
processed ( Disque\Queue\JobInterface $job ) : void Acknowledges a Job as properly handled
processing ( Disque\Queue\JobInterface $job ) : integer Marks that a Job is still being processed
pull ( integer $timeout ) : Disque\Queue\Job | null Pulls a single job from the queue (if none available, and if $timeout specified, then wait only this much time for a job, otherwise return null)
push ( Disque\Queue\JobInterface $job, array $options = [] ) : Disque\Queue\JobInterface Pushes a job into the queue
schedule ( Disque\Queue\JobInterface $job, DateTime $when ) : Disque\Queue\JobInterface Pushes a job into the queue, setting it to be up for processing only at the specific date & time.
setMarshaler ( Disque\Queue\Marshal\MarshalerInterface $marshaler ) : void Set Job marshaler

Приватные методы

Метод Описание
checkConnected ( ) : void Check that we are connected to a node, and if not connect

Описание методов

__construct() публичный Метод

Create a queue
public __construct ( Client $client, string $name )
$client Disque\Client Client
$name string Queue name

failed() публичный Метод

This increases the NACK counter of the job
public failed ( Disque\Queue\JobInterface $job ) : void
$job Disque\Queue\JobInterface
Результат void

processed() публичный Метод

Acknowledges a Job as properly handled
public processed ( Disque\Queue\JobInterface $job ) : void
$job Disque\Queue\JobInterface Job
Результат void

processing() публичный Метод

Marks that a Job is still being processed
public processing ( Disque\Queue\JobInterface $job ) : integer
$job Disque\Queue\JobInterface Job
Результат integer Number of seconds that the job visibility was postponed

pull() публичный Метод

Pulls a single job from the queue (if none available, and if $timeout specified, then wait only this much time for a job, otherwise return null)
public pull ( integer $timeout ) : Disque\Queue\Job | null
$timeout integer If specified, wait these many seconds
Результат Disque\Queue\Job | null A job, or null if no job was found before timeout

push() публичный Метод

Pushes a job into the queue
public push ( Disque\Queue\JobInterface $job, array $options = [] ) : Disque\Queue\JobInterface
$job Disque\Queue\JobInterface Job
$options array ADDJOB options sent to the client
Результат Disque\Queue\JobInterface Job pushed

schedule() публичный Метод

Pushes a job into the queue, setting it to be up for processing only at the specific date & time.
public schedule ( Disque\Queue\JobInterface $job, DateTime $when ) : Disque\Queue\JobInterface
$job Disque\Queue\JobInterface Job
$when DateTime Date & time on when job should be ready for processing
Результат Disque\Queue\JobInterface Job pushed

setMarshaler() публичный Метод

Set Job marshaler
public setMarshaler ( Disque\Queue\Marshal\MarshalerInterface $marshaler ) : void
$marshaler Disque\Queue\Marshal\MarshalerInterface
Результат void

Описание свойств

$client защищенное свойство

Client
protected Client,Disque $client
Результат Disque\Client

$name защищенное свойство

Name
protected string $name
Результат string