PHP 클래스 AppserverIo\Appserver\MessageQueue\MessageQueue

상속: extends AppserverIo\Appserver\Core\AbstractDaemonThread, implements AppserverIo\Psr\Pms\QueueInterface
파일 보기 프로젝트 열기: appserver-io/appserver 1 사용 예제들

공개 메소드들

메소드 설명
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