承接 haldayne/fox 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

haldayne/fox

Composer 安装命令:

composer require haldayne/fox

包简介

PHP implementation of generic, higher-order functions.

README 文档

README

Many algorithms are generic. That is, the way the algorithm functions is independent of what the algorithm does to the underlying data. These generic algorithms can be wrapped in a reusable function.

This package provides reusable, generic functions implemented using the callable object pattern. You can nest these generic functions to solve more complex problems. See below and the docs.

Latest Stable Version Build Status Coverage Status Monthly Downloads

Installation

Install with composer: php composer.phar require haldayne/fox ^1.0

Requires PHP version 5.5.0 or higher. No other PHP extensions are required.

Select examples

Retry a function until it either succeeds or reaches the maximum number of attempts. Delay each attempt by an exponentially increasing time:

$retry = new \Haldayne\Fox\Retry(
    function ($src, $dst) { return copy($src, $dst); }
);
$retry->setAttempts(3);
$retry('ssh2.sftp://user:pass@host/the/file', 'thefile')
    or die("Copy failed after {$retry->getAttempts()} attempts");

Package contents and documentation

Extensive documentation is available at Read the Docs:

Contributing

Your contribution is welcome! Open an issue or create a gist showing how you're using fox. If you want to add a new algorithm to fox, please keep these in mind:

  • Please fork the repository and create a PR.
  • Use PSR-2.
  • Update tests so that you have at least 80% coverage.
  • Choose something useful. If the algorithm takes many arguments, or exposes state after calculating a result, it's a good candidate.

Miscellaneous

These algorithms can be composed together. The repository name fox is an abbreviation for f(x) said "f of x", which harks back to these functions' compositional ability.

Both Go and Java have implementations of the Retry function with exponential backoff.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-11-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固