프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$redis | Instance of Resque_Redis that talks to redis. |
프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$redisDatabase | ID of Redis database to select. | ||
$redisServer | Host/port conbination separated by a colon, or a nested array of server swith host/port pairs |
메소드 | 설명 | |
---|---|---|
blpop ( array $queues, integer $timeout ) : null | array | Pop an item off the end of the specified queues, using blocking list pop, decode it and return it. | |
dequeue ( string $queue, array $items = [] ) : integer | Remove items of the specified queue | |
enqueue ( string $queue, string $class, array $args = null, boolean $trackStatus = false ) : string | boolean | Create a new job and save it to the specified queue. | |
fork ( ) : integer | fork() helper method for php-resque that handles issues PHP socket and phpredis have with passing around sockets between child/parent processes. | |
generateJobId ( ) | * Generate an identifier to attach to a job for status tracking. | |
pop ( string $queue ) : array | Pop an item off the end of the specified queue, decode it and return it. | |
push ( string $queue, array $item ) | Push a job to the end of a specific queue. If the queue does not exist, then create it as well. | |
queues ( ) : array | Get an array of all known queues. | |
redis ( ) : Resque_Redis | Return an instance of the Resque_Redis class instantiated for Resque. | |
removeQueue ( string $queue ) : integer | Remove specified queue | |
reserve ( string $queue ) : Resque_Job | Reserve and return the next available job in the specified queue. | |
setBackend ( mixed $server, integer $database ) | Given a host/port combination separated by a colon, set it as the redis server that Resque will talk to. | |
size ( string $queue ) : integer | Return the size (number of pending jobs) of the specified queue. |
메소드 | 설명 | |
---|---|---|
matchItem ( $string, $items ) : (bool) | matching item item can be ['class'] or ['class' => 'id'] or ['class' => {:foo => 1, :bar => 2}] | |
removeItems ( string $queue, array $items = [] ) : integer | Remove Items from the queue Safely moving each item to a temporary queue before processing it If the Job matches, counts otherwise puts it in a requeue_queue which at the end eventually be copied back into the original queue | |
removeList ( $queue ) : integer | Remove List |
public static enqueue ( string $queue, string $class, array $args = null, boolean $trackStatus = false ) : string | boolean | ||
$queue | string | The name of the queue to place the job in. |
$class | string | The name of the class that contains the code to execute the job. |
$args | array | Any optional arguments that should be passed when the job is executed. |
$trackStatus | boolean | Set to true to be able to monitor the status of a job. |
리턴 | string | boolean | Job ID when the job was created, false if creation was cancelled due to beforeEnqueue |
public static generateJobId ( ) |
public static redis ( ) : Resque_Redis | ||
리턴 | Resque_Redis | Instance of Resque_Redis. |
public static removeQueue ( string $queue ) : integer | ||
$queue | string | The name of the queue to remove. |
리턴 | integer | Number of deleted items |
public static setBackend ( mixed $server, integer $database ) | ||
$server | mixed | Host/port combination separated by a colon, DSN-formatted URI, or a callable that receives the configured database ID and returns a Resque_Redis instance, or a nested array of servers with host/port pairs. |
$database | integer |