PHP Class AppserverIo\Appserver\MessageQueue\MessageQueue

Inheritance: extends AppserverIo\Appserver\Core\AbstractDaemonThread, implements AppserverIo\Psr\Pms\QueueInterface
Afficher le fichier Open project: appserver-io/appserver Class Usage Examples

Méthodes publiques

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

Méthodes protégées

Méthode Description
uniqueWorkerName ( AppserverIo\Psr\Pms\PriorityKeyInterface $priorityKey ) : string Creates a unique name to register the worker with the passed priority.

Method Details

attach() public méthode

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
Résultat void

bootstrap() public méthode

This method will be invoked before the while() loop starts and can be used to implement some bootstrap functionality.
public bootstrap ( ) : void
Résultat void

cleanUp() public méthode

This method will be invoked, after the while() loop has been finished and can be used to implement clean up functionality.
public cleanUp ( ) : void
Résultat void

getApplication() public méthode

Returns the application instance the worker is bound to.
public getApplication ( ) : AppserverIo\Psr\Application\ApplicationInterface
Résultat AppserverIo\Psr\Application\ApplicationInterface The application instance

getManagerSettings() public méthode

Return's the queue manager settings.
public getManagerSettings ( ) : AppserverIo\Appserver\MessageQueue\QueueManagerSettingsInterface
Résultat AppserverIo\Appserver\MessageQueue\QueueManagerSettingsInterface The queue manager settings

getMessages() public méthode

Returns the storage for the messages.
public getMessages ( ) : AppserverIo\Storage\GenericStackable
Résultat AppserverIo\Storage\GenericStackable The storage for the messages

getName() public méthode

Returns the queue name.
public getName ( ) : string
Résultat string The queue name

getType() public méthode

Returns the message bean type to handle the messages.
public getType ( ) : string
Résultat string The message bean type to handle the messages

getWorkers() public méthode

Returns the storage for the workers.
public getWorkers ( ) : AppserverIo\Storage\GenericStackable
Résultat AppserverIo\Storage\GenericStackable The storage for the workers

injectApplication() public méthode

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
Résultat void

injectManagerSettings() public méthode

Injects the queue manager settings.
public injectManagerSettings ( AppserverIo\Appserver\MessageQueue\QueueManagerSettingsInterface $managerSettings ) : void
$managerSettings AppserverIo\Appserver\MessageQueue\QueueManagerSettingsInterface The queue manager settings
Résultat void

injectMessages() public méthode

Injects the storage for the messages.
public injectMessages ( AppserverIo\Storage\GenericStackable $messages ) : void
$messages AppserverIo\Storage\GenericStackable An storage for the messages
Résultat void

injectName() public méthode

Initializes the queue with the name to use.
public injectName ( string $name ) : void
$name string Holds the queue name to use
Résultat void

injectType() public méthode

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
Résultat void

injectWorkers() public méthode

Injects the storage for the workers.
public injectWorkers ( AppserverIo\Storage\GenericStackable $workers ) : void
$workers AppserverIo\Storage\GenericStackable An storage for the workers
Résultat void

log() public méthode

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
Résultat void

uniqueWorkerName() protected méthode

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
Résultat string The unique name