Skip to main content

Package to manage functions call rate

Project description

# Install

```
python3 setup.py install
```

# Usage

``` python
import threading
from callrate import call_rate
import time


@call_rate(7, 10, False)
def test_print(i):
print("Thread -> {}".format(i))


def test_thread(i):
while True:
try:
test_print(i)
except:
pass


def main():
threads = []
for i in range(10):
threads.append(threading.Thread(target=test_thread, args=(i, )))
threads[-1].start()

for thread in threads:
thread.join()

if __name__ == "__main__":
main()
```

# Warning
Note that the `call_rate` and `CallRate` is thread safe (not process safe)

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 callrate, version 2018.4
Filename, size File type Python version Upload date Hashes
Filename, size callrate-2018.4.tar.gz (1.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page