abstract class QueueAdapter (View source)

Constants

EXIT_SUCCESS

EXIT_ERROR

EXIT_MEMORY_LIMIT

Properties

protected int $start_time

Define the start time

protected string $queue

Determine the default watch name

protected int $tries

The number of working attempts

protected int $sleep

Define the sleep time

Methods

configure(array $config)

Make adapter configuration

void
push(ProducerService $producer)

Push new producer

string
serializeProducer(ProducerService $producer)

Create producer serialization

unserializeProducer(string $producer)

Create producer unserialize

void
sleep(int $seconds)

Sleep the process

void
work(int $timeout, int $memory)

Laund the worker

never
kill(int $status = 0)

Kill the process.

bool
timeoutReached(int $timeout)

Determine if the timeout is reached

void
listenForSignals()

Enable async signals for the process.

bool
supportsAsyncSignals()

Determine if "async" signals are supported.

void
setTries(int $tries)

Set job tries

void
setSleep(int $sleep)

Set sleep time

string
getQueue(string|null $queue = null)

Get the queue or return the default.

string
generateId()

Generate the job id

int
size(string $queue)

Get the queue size

void
run(string|null $queue = null)

Start the worker server

void
flush(string|null $queue = null)

Flush the queue

void
setQueue(string $queue)

Watch the queue name

Details

abstract QueueAdapter configure(array $config)

Make adapter configuration

Parameters

array $config

Return Value

QueueAdapter

abstract void push(ProducerService $producer)

Push new producer

Parameters

ProducerService $producer

Return Value

void

string serializeProducer(ProducerService $producer)

Create producer serialization

Parameters

ProducerService $producer

Return Value

string

ProducerService unserializeProducer(string $producer)

Create producer unserialize

Parameters

string $producer

Return Value

ProducerService

void sleep(int $seconds)

Sleep the process

Parameters

int $seconds

Return Value

void

final void work(int $timeout, int $memory)

Laund the worker

Parameters

int $timeout
int $memory

Return Value

void

never kill(int $status = 0)

Kill the process.

Parameters

int $status

Return Value

never

protected bool timeoutReached(int $timeout)

Determine if the timeout is reached

Parameters

int $timeout

Return Value

bool

protected void listenForSignals()

Enable async signals for the process.

Return Value

void

protected bool supportsAsyncSignals()

Determine if "async" signals are supported.

Return Value

bool

void setTries(int $tries)

Set job tries

Parameters

int $tries

Return Value

void

void setSleep(int $sleep)

Set sleep time

Parameters

int $sleep

Return Value

void

string getQueue(string|null $queue = null)

Get the queue or return the default.

Parameters

string|null $queue

Return Value

string

string generateId()

Generate the job id

Return Value

string

int size(string $queue)

Get the queue size

Parameters

string $queue

Return Value

int

void run(string|null $queue = null)

Start the worker server

Parameters

string|null $queue

Return Value

void

void flush(string|null $queue = null)

Flush the queue

Parameters

string|null $queue

Return Value

void

void setQueue(string $queue)

Watch the queue name

Parameters

string $queue

Return Value

void