ekomobile/retry 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ekomobile/retry

Composer 安装命令:

composer require ekomobile/retry

包简介

Retry with backoff

README 文档

README

Build Status GitHub release Downloads Coverage Maintainability Tech debt

This is a PHP port of https://github.com/cenkalti/backoff (thanks, @cenkalti), which is a port of the exponential backoff algorithm from Google's HTTP Client Library for Java.

Exponential backoff is an algorithm that uses feedback to multiplicatively decrease the rate of some process, in order to gradually find an acceptable rate. The retries exponentially increase and stop increasing when a certain threshold is met.

Examples

Simple

Retry with default exponential backoff.

(new Retry(function () {
    // workload ...
}))();

Advanced

$operation = function () {
  // workload ...
  if ($somePermanentFailCondition) {
    throw new \Ekomobile\Retry\Exception\Permanent(new \Exception('Unretryable error'))
  }
  // ...
  throw new Exception('Retryable error')
};

$backoff = new \Ekomobile\Retry\Backoff\WithMaxRetries(new \Ekomobile\Retry\Backoff\Exponential(), 5);

$notify = function (\Throwable $e) {
  // $logger->log($e);
};

$retry = new \Ekomobile\Retry\Retry($operation, $backoff, $notify);
$retry();

统计信息

  • 总下载量: 546
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-12-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固