Skip to main content

To keep the old heart ticking

Project description

CircleCI branch PyPI version PyPI - Python Version Quality Gate Status

Pace Maker

There are times in your life when you have to call legacy api's that can handle like 2 reqs/sec. There is no point hammering the old man and killing him.

This library will help you pace calls to the old man, so his heart keeps ticking.

Combining this library with backoff( can do wonders.


python3 -m pip install pacemaker-mkeshav


    from pacemaker import pace_me

    # Function that will yield data that the process function needs
    def data_gen(n=3):
        for i in range(n):
            yield [x for x in range(n)]

    # Will make 3 requests to that url/sec using 1 token everytime process method is called. What data_gen function yields should be the first argument
    @pace_me(data_gen, rate_per_second=3, n=6)
    def process(data, url):
        r =, data=data)

Run tests

  • All tests (docker-compose run --rm test)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pacemaker-mkeshav, version 0.2.6
Filename, size File type Python version Upload date Hashes
Filename, size pacemaker_mkeshav-0.2.6-py3-none-any.whl (4.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pacemaker-mkeshav-0.2.6.tar.gz (3.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page