Skip to content

Commit

Permalink
Lock aeon-php/process dependency to ^0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
norberttech committed Jul 13, 2020
1 parent 594d07e commit 10fcee3
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 132 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.0] - 2020-07-13
### First release :tada:
- initial release
47 changes: 1 addition & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,49 +12,4 @@ Time Management Framework for PHP
[Source: Wikipedia](https://en.wikipedia.org/wiki/Aeon)

Retry operations that might fail like for example http requests, with different
delay modifiers.

```php
<?php

use Aeon\Calendar\TimeUnit;
use Aeon\Retry\Execution;
use function Aeon\Retry\retry;

$result = retry(function (Execution $execution) {
$random = \random_int(1, 3);

if ($random === 2) {
throw new \RuntimeException('exception');
}

return $random;
}, 3, TimeUnit::seconds(3));
```

Object implementation that multiplies delays by retry number after each failure.

```php
<?php

use Aeon\Calendar\System\SystemProcess;use Aeon\Calendar\TimeUnit;
use Aeon\Retry\DelayModifier\RetryMultiplyDelay;use Aeon\Retry\Execution;
use Aeon\Retry\Retry;

return (new Retry(
SystemProcess::current(),
5,
TimeUnit::milliseconds(100)
))->modifyDelay(
new RetryMultiplyDelay()
)->execute(function (Execution $execution) {
$random = \random_int(1, 3);

if ($random === 2) {
throw new \RuntimeException('exception');
}

return $random;
});
```
Please read [Official Documentation](https://aeon-php.org/docs/retry).
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"minimum-stability": "dev",
"require": {
"php": ">=7.4.2",
"aeon-php/process": "^1.0@dev"
"aeon-php/process": "^0.1.0"
},
"require-dev": {
"phpunit/phpunit": "^9.1",
Expand Down
Loading

0 comments on commit 10fcee3

Please sign in to comment.