1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
Source: python-roundrobin
Section: python
Priority: optional
Maintainer: Sandro Tosi <morph@debian.org>
Build-Depends: debhelper-compat (= 13),
dh-python,
python3-all,
python3-setuptools,
Standards-Version: 4.6.2.0
Testsuite: autopkgtest-pkg-pybuild
Homepage: https://github.com/linnik/roundrobin
Vcs-Git: https://salsa.debian.org/morph/python-roundrobin.git
Vcs-Browser: https://salsa.debian.org/morph/python-roundrobin
Rules-Requires-Root: no
Package: python3-roundrobin
Architecture: all
Depends: ${misc:Depends},
${python3:Depends},
Description: collection of roundrobin utilities
This is rather small collection of round robin utilities.
.
Some examples:
.
```
>>> import roundrobin
>>> get_roundrobin = roundrobin.basic(["A", "B", "C"])
>>> ''.join([get_roundrobin() for _ in range(7)])
'ABCABCA'
>>> # weighted round-robin balancing algorithm as seen in LVS
>>> get_weighted = roundrobin.weighted([("A", 5), ("B", 1), ("C", 1)])
>>> ''.join([get_weighted() for _ in range(7)])
'AAAAABC'
>>> # smooth weighted round-robin balancing algorithm as seen in Nginx
>>> get_weighted_smooth = roundrobin.smooth([("A", 5), ("B", 1), ("C", 1)])
>>> ''.join([get_weighted_smooth() for _ in range(7)])
'AABACAA'
```
|