Skip to content

Instantly share code, notes, and snippets.

@DrJackilD
DrJackilD / comm.py
Created June 1, 2016 05:43 — forked from drocco007/comm.py
Python generator rate limiter using token bucket
from time import time, sleep
_128k = 128 * 1024
_256k = 256 * 1024
_512k = 512 * 1024
_1024k = 1024 * 1024
class TokenBucket(object):