类 Message
命名空间: Cake\Queue\Job
属性摘要
-
$callable protected
?Closure
-
$container protected
?ContainerInterface
-
$context protected
Context
-
$originalMessage protected
QueueMessage
-
$parsedBody protected
array
方法摘要
-
__construct() public
-
__toString() public
-
getArgument() public
-
getCallable() public
获取包含任务中可调用函数的闭包。
-
getContext() public
-
getMaxAttempts() public
任务允许的最大尝试次数。
-
getOriginalMessage() public
-
getParsedBody() public
-
getTarget() public
获取目标类和方法。
-
jsonSerialize() public
方法详情
__construct() ¶ public
__construct(Interop\Queue\Message $originalMessage, Interop\Queue\Context $context, Cake\Core\ContainerInterface|null $container = null)
参数
-
Interop\Queue\Message
$originalMessage 队列消息。
-
Interop\Queue\Context
$context 上下文。
-
Cake\Core\ContainerInterface|null
$container optional DI 容器实例
getArgument() ¶ public
getArgument(mixed $key = null, mixed $default = null): mixed
参数
-
mixed
$key optional 键
-
mixed
$default optional 默认值。
返回值
mixed
getCallable() ¶ public
getCallable(): Closure
获取包含任务中可调用函数的闭包。
支持的可调用函数包括
- [class, method] 数组。该类将使用无构造函数参数进行构造。
返回值
闭包