Class LimitAttemptsExtension
Constants
-
string
ATTEMPTS_PROPERTY ¶'attempts'
The property key used to set the number of times a message was attempted.
Property Summary
-
$_eventClass protected
string
Default class name for new event objects.
-
$_eventManager protected
Cake\Event\EventManagerInterface|null
Instance of the Cake\Event\EventManager this object is using to dispatch inner events.
-
$maxAttempts protected
int|null
The maximum number of times a job may be attempted. $maxAttempts defined on a Job will override this value.
Method Summary
-
__construct() public
-
dispatchEvent() public
Wrapper for creating and dispatching events.
-
getEventManager() public
Returns the Cake\Event\EventManager manager instance for this object.
-
onResult() public
Executed when a message is processed by a processor or a result was set in onMessageReceived extension method. BEFORE the message status was sent to the broker The result could be changed at this point.
-
setEventManager() public
Returns the Cake\Event\EventManagerInterface instance for this object.
Method Detail
__construct() ¶ public
__construct(int|null $maxAttempts = null): void
Parameters
-
int|null
$maxAttempts optional The maximum number of times a job may be attempted.
Returns
void
dispatchEvent() ¶ public
dispatchEvent(string $name, array $data = [], TSubject|null $subject = null): Cake\Event\EventInterface<TSubject>
Wrapper for creating and dispatching events.
Returns a dispatched event.
Parameters
-
string
$name Name of the event.
-
array
$data optional Any value you wish to be transported with this event to it can be read by listeners.
-
TSubject|null
$subject optional The object that this event applies to ($this by default).
Returns
Cake\Event\EventInterface<TSubject>
getEventManager() ¶ public
getEventManager(): Cake\Event\EventManagerInterface
Returns the Cake\Event\EventManager manager instance for this object.
You can use this instance to register any new listeners or callbacks to the object events, or create your own events and trigger them at will.
Returns
Cake\Event\EventManagerInterface
onResult() ¶ public
onResult(MessageResult $context): void
Executed when a message is processed by a processor or a result was set in onMessageReceived extension method. BEFORE the message status was sent to the broker The result could be changed at this point.
Parameters
-
MessageResult
$context The result of the message after it was processed.
Returns
void
setEventManager() ¶ public
setEventManager(Cake\Event\EventManagerInterface $eventManager): $this
Returns the Cake\Event\EventManagerInterface instance for this object.
You can use this instance to register any new listeners or callbacks to the object events, or create your own events and trigger them at will.
Parameters
-
Cake\Event\EventManagerInterface
$eventManager the eventManager to set
Returns
$this
Property Detail
$_eventManager ¶ protected
Instance of the Cake\Event\EventManager this object is using to dispatch inner events.
Type
Cake\Event\EventManagerInterface|null
$maxAttempts ¶ protected
The maximum number of times a job may be attempted. $maxAttempts defined on a Job will override this value.
Type
int|null