Skip to content

Commit

Permalink
Merge pull request #1 from CMProductions/small_seed_strength_improve
Browse files Browse the repository at this point in the history
Small seed improve
  • Loading branch information
Hilari Moragrega authored Jun 13, 2017
2 parents 1bc21f6 + 3fcf3fd commit 85c8e9b
Show file tree
Hide file tree
Showing 7 changed files with 608 additions and 537 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ $path = $balancer->get("home_banner");
* Deterministic balance, given a configuration and a valid seed,
* you'll always get the same result
*
* Valid seeds are non-empty strings and unsigned integers
* Valid seeds are non-empty strings and unsigned numbers
*/
$path = $balancer->get("after_update_email", 78549612);
$path = $balancer->get("after_update_email", -4.75);
$path = $balancer->get("after_update_email", "[email protected]");
```

Expand Down Expand Up @@ -140,12 +141,12 @@ $path = $balancer->get("home_banner");
### Seed based deterministic retrieval
If you pass a seed, the path will be decided using a simple yet infallible algorithm so that for *every given configuration and seed, it will always choose the same path*

**NOTE** This means that the path can change if either the configuration orthe seed changes
**NOTE** This means that the path can change if either the configuration or the seed changes

You can pass both signed integers or non-empty strings as seed
You can pass both signed numbers (integers and doubles) or non-empty strings as seed

```php
$path = $balancer->get("after_update_email", 78549612);
$path = $balancer->get("after_update_email", -23);
$path = $balancer->get("after_update_email", -23.54);
$path = $balancer->get("after_update_email", "[email protected]");
```
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"require-dev": {
"phpspec/phpspec": "^2.0",
"phpunit/php-code-coverage": "^2.2",
"pluggit/monitoring": "^2.0"
"pluggit/monitoring": "^2.0",
"coduo/phpspec-data-provider-extension": "^1.0"
},
"config": {
"bin-dir": "bin"
Expand Down
Loading

0 comments on commit 85c8e9b

Please sign in to comment.