-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from CMProductions/small_seed_strength_improve
Small seed improve
- Loading branch information
Showing
7 changed files
with
608 additions
and
537 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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]"); | ||
``` | ||
|
||
|
@@ -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]"); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.