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:

  1. RepoOne
  2. RepoTwo
  3. RepoTwo
  4. RepoTwo
  5. RepoThree
  6. RepoThree
  7. RepoOne etc etc etc

Link to this section Summary

Link to this section Functions

Link to this function get_repo(repos)

Callback implementation for EctoFacade.Algorithm.get_repo/1.