Collection of roundrobin utilities
Project description
This is rather small collection of round robin utilites
>>> 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'
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
roundrobin-0.0.1.tar.gz
(2.0 kB
view hashes)
Built Distribution
Close
Hashes for roundrobin-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bba3416a1be6863b81fb7839cf3f041ed9550c12d986603d225377fb32a20736 |
|
MD5 | aef864d03807dfc848a419f8bbd5bb99 |
|
BLAKE2b-256 | 7ac042e504c02e53efeadbcd09102fc124dd5f289ce0b3f19989394f1caa9bd6 |