ecto_facade v0.2.1 EctoFacade.Algorithms.WeightRoundrobin
Algorithm that selects read repository, based on weight. The bigger weight indicates that repo should be used more frequently. By default, each repo have assigned weight 0.
Example: read_repos = [{RepoOne, 0}, {RepoTwo, 2}, {RepoThree, 1}]
order in which what repos will be used:
- RepoOne
- RepoTwo
- RepoTwo
- RepoTwo
- RepoThree
- RepoThree
- RepoOne etc etc etc
Link to this section Summary
Functions
Callback implementation for EctoFacade.Algorithm.get_repo/1
Link to this section Functions
Link to this function
get_repo(repos)
Callback implementation for EctoFacade.Algorithm.get_repo/1
.