Skip to main content

Collection of roundrobin utilities

Project description

Build Status PyPI install versions

roundrobin

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.3.tar.gz (3.3 kB view details)

Uploaded Source

File details

Details for the file roundrobin-0.0.3.tar.gz.

File metadata

  • Download URL: roundrobin-0.0.3.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for roundrobin-0.0.3.tar.gz
Algorithm Hash digest
SHA256 a0aec00cb6e4159fe3d1f914f3f51f8b803e5e4efb13dcfd632e2931a2b12344
MD5 2477f4608a568e1dec1ba44549762c77
BLAKE2b-256 6d0a6ae43dd8717ed1031fcf329c5576af35e5d8f8e8f2b96d05adbfe893862e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page