PHP Class Disque\Queue\Queue

Afficher le fichier Open project: mariano/disque-php

Protected Properties

Свойство Type Description
$client Disque\Client Client
$name string Name

Méthodes publiques

Méthode Description
__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

Private Methods

Méthode Description
checkConnected ( ) : void Check that we are connected to a node, and if not connect

Method Details

__construct() public méthode

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

failed() public méthode

This increases the NACK counter of the job
public failed ( Disque\Queue\JobInterface $job ) : void
$job Disque\Queue\JobInterface
Résultat void

processed() public méthode

Acknowledges a Job as properly handled
public processed ( Disque\Queue\JobInterface $job ) : void
$job Disque\Queue\JobInterface Job
Résultat void

processing() public méthode

Marks that a Job is still being processed
public processing ( Disque\Queue\JobInterface $job ) : integer
$job Disque\Queue\JobInterface Job
Résultat integer Number of seconds that the job visibility was postponed

pull() public méthode

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
Résultat Disque\Queue\Job | null A job, or null if no job was found before timeout

push() public méthode

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
Résultat Disque\Queue\JobInterface Job pushed

schedule() public méthode

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
Résultat Disque\Queue\JobInterface Job pushed

setMarshaler() public méthode

Set Job marshaler
public setMarshaler ( Disque\Queue\Marshal\MarshalerInterface $marshaler ) : void
$marshaler Disque\Queue\Marshal\MarshalerInterface
Résultat void

Property Details

$client protected_oe property

Client
protected Client,Disque $client
Résultat Disque\Client

$name protected_oe property

Name
protected string $name
Résultat string