CakePHP
  • 文档
    • 书籍
    • API
    • 视频
    • 报告安全问题
    • 隐私政策
    • 标识和商标
  • 商业解决方案
  • 商品
  • 公路旅行
  • 团队
  • 社区
    • 社区
    • 参与进来
    • 问题 (Github)
    • 烘焙坊
    • 精选资源
    • 培训
    • 聚会
    • 我的 CakePHP
    • CakeFest
    • 时事通讯
    • LinkedIn
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • 帮助和支持
    • 论坛
    • Stack Overflow
    • IRC
    • Slack
    • 付费支持
CakePHP

C CakePHP 5.1 Chiffon API

  • 项目
    • CakePHP
      • CakePHP
      • Chronos
      • Elastic Search
      • 队列
  • 版本
    • 5.1
      • 5.1
      • 5.0
      • 4.5
      • 4.4
      • 4.3
      • 4.2
      • 4.1
      • 4.0
      • 3.10
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

命名空间

  • 全局
  • Cake
    • Cache
    • Collection
    • Command
    • Console
    • Controller
    • Core
      • Configure
      • Exception
      • Retry
      • TestSuite
    • Database
    • Datasource
    • Error
    • Event
    • Form
    • Http
    • I18n
    • Log
    • Mailer
    • Network
    • ORM
    • Routing
    • TestSuite
    • Utility
    • Validation
    • View

类 CommandRetry

允许任何操作在遇到异常时重试。

此类可以使用策略进行参数化,该策略将用于确定是否应重试该操作。

命名空间: Cake\Core\Retry

属性摘要

  • $maxRetries protected
    int
  • $numRetries protected
    int
  • $strategy protected
    Cake\Core\Retry\RetryStrategyInterface

    如果执行的操作失败,则应遵循的策略。

方法摘要

  • __construct() public

    使用给定的策略和重试次数创建 CommandRetry 对象

  • getRetries() public

    返回最后一次重试尝试的次数。

  • run() public

    失败时要执行的重试次数

方法详情

__construct() ¶ public

__construct(Cake\Core\Retry\RetryStrategyInterface $strategy, int $maxRetries = 1)

使用给定的策略和重试次数创建 CommandRetry 对象

参数
Cake\Core\Retry\RetryStrategyInterface $strategy

如果操作失败,则应遵循的策略

int $maxRetries optional

允许的最大重试次数

getRetries() ¶ public

getRetries(): int

返回最后一次重试尝试的次数。

返回值
int

run() ¶ public

run(Closure $action): mixed

失败时要执行的重试次数

参数
Closure $action

每次尝试要运行的回调

返回值
混合
抛出
Exception
抛出最后一次失败的异常

属性详情

$maxRetries ¶ protected

类型
int

$numRetries ¶ protected

类型
int

$strategy ¶ protected

如果执行的操作失败,则应遵循的策略。

类型
Cake\Core\Retry\RetryStrategyInterface
OpenHub
Pingping
Linode
  • 商业解决方案
  • 展示
  • 文档
  • 书籍
  • API
  • 视频
  • 报告安全问题
  • 隐私政策
  • 标识和商标
  • 社区
  • 参与进来
  • 问题 (Github)
  • 烘焙坊
  • 精选资源
  • 培训
  • 聚会
  • 我的 CakePHP
  • CakeFest
  • 时事通讯
  • LinkedIn
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • 帮助和支持
  • 论坛
  • Stack Overflow
  • IRC
  • Slack
  • 付费支持

使用 CakePHP API 文档 生成