PHP Класс AppserverIo\Appserver\MessageQueue\MessageQueue

Автор: Tim Wagner ([email protected])
Наследование: extends AppserverIo\Appserver\Core\AbstractDaemonThread, implements AppserverIo\Psr\Pms\QueueInterface
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
attach ( AppserverIo\Psr\Pms\MessageInterface $message ) : void Attach a new message to the queue.
bootstrap ( ) : void This method will be invoked before the while() loop starts and can be used to implement some bootstrap functionality.
cleanUp ( ) : void This method will be invoked, after the while() loop has been finished and can be used to implement clean up functionality.
getApplication ( ) : AppserverIo\Psr\Application\ApplicationInterface Returns the application instance the worker is bound to.
getManagerSettings ( ) : AppserverIo\Appserver\MessageQueue\QueueManagerSettingsInterface Return's the queue manager settings.
getMessages ( ) : AppserverIo\Storage\GenericStackable Returns the storage for the messages.
getName ( ) : string Returns the queue name.
getType ( ) : string Returns the message bean type to handle the messages.
getWorkers ( ) : AppserverIo\Storage\GenericStackable Returns the storage for the workers.
injectApplication ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void Inject the application instance the worker is bound to.
injectManagerSettings ( AppserverIo\Appserver\MessageQueue\QueueManagerSettingsInterface $managerSettings ) : void Injects the queue manager settings.
injectMessages ( AppserverIo\Storage\GenericStackable $messages ) : void Injects the storage for the messages.
injectName ( string $name ) : void Initializes the queue with the name to use.
injectType ( string $type ) : void Initializes the queue with the message bean type that has to handle the messages.
injectWorkers ( AppserverIo\Storage\GenericStackable $workers ) : void Injects the storage for the workers.
log ( mixed $level, string $message, array $context = [] ) : void This is a very basic method to log some stuff by using the error_log() method of PHP.

Защищенные методы

Метод Описание
uniqueWorkerName ( AppserverIo\Psr\Pms\PriorityKeyInterface $priorityKey ) : string Creates a unique name to register the worker with the passed priority.

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

attach() публичный метод

Attach a new message to the queue.
public attach ( AppserverIo\Psr\Pms\MessageInterface $message ) : void
$message AppserverIo\Psr\Pms\MessageInterface The messsage to be attached to the queue
Результат void

bootstrap() публичный метод

This method will be invoked before the while() loop starts and can be used to implement some bootstrap functionality.
public bootstrap ( ) : void
Результат void

cleanUp() публичный метод

This method will be invoked, after the while() loop has been finished and can be used to implement clean up functionality.
public cleanUp ( ) : void
Результат void

getApplication() публичный метод

Returns the application instance the worker is bound to.
public getApplication ( ) : AppserverIo\Psr\Application\ApplicationInterface
Результат AppserverIo\Psr\Application\ApplicationInterface The application instance

getManagerSettings() публичный метод

Return's the queue manager settings.
public getManagerSettings ( ) : AppserverIo\Appserver\MessageQueue\QueueManagerSettingsInterface
Результат AppserverIo\Appserver\MessageQueue\QueueManagerSettingsInterface The queue manager settings

getMessages() публичный метод

Returns the storage for the messages.
public getMessages ( ) : AppserverIo\Storage\GenericStackable
Результат AppserverIo\Storage\GenericStackable The storage for the messages

getName() публичный метод

Returns the queue name.
public getName ( ) : string
Результат string The queue name

getType() публичный метод

Returns the message bean type to handle the messages.
public getType ( ) : string
Результат string The message bean type to handle the messages

getWorkers() публичный метод

Returns the storage for the workers.
public getWorkers ( ) : AppserverIo\Storage\GenericStackable
Результат AppserverIo\Storage\GenericStackable The storage for the workers

injectApplication() публичный метод

Inject the application instance the worker is bound to.
public injectApplication ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void
$application AppserverIo\Psr\Application\ApplicationInterface The application instance
Результат void

injectManagerSettings() публичный метод

Injects the queue manager settings.
public injectManagerSettings ( AppserverIo\Appserver\MessageQueue\QueueManagerSettingsInterface $managerSettings ) : void
$managerSettings AppserverIo\Appserver\MessageQueue\QueueManagerSettingsInterface The queue manager settings
Результат void

injectMessages() публичный метод

Injects the storage for the messages.
public injectMessages ( AppserverIo\Storage\GenericStackable $messages ) : void
$messages AppserverIo\Storage\GenericStackable An storage for the messages
Результат void

injectName() публичный метод

Initializes the queue with the name to use.
public injectName ( string $name ) : void
$name string Holds the queue name to use
Результат void

injectType() публичный метод

Initializes the queue with the message bean type that has to handle the messages.
public injectType ( string $type ) : void
$type string The message bean type to handle the messages
Результат void

injectWorkers() публичный метод

Injects the storage for the workers.
public injectWorkers ( AppserverIo\Storage\GenericStackable $workers ) : void
$workers AppserverIo\Storage\GenericStackable An storage for the workers
Результат void

log() публичный метод

This is a very basic method to log some stuff by using the error_log() method of PHP.
public log ( mixed $level, string $message, array $context = [] ) : void
$level mixed The log level to use
$message string The message we want to log
$context array The context we of the message
Результат void

uniqueWorkerName() защищенный метод

Creates a unique name to register the worker with the passed priority.
protected uniqueWorkerName ( AppserverIo\Psr\Pms\PriorityKeyInterface $priorityKey ) : string
$priorityKey AppserverIo\Psr\Pms\PriorityKeyInterface The priority key to create a unique name for
Результат string The unique name