Skip to main content

throttle

Standalone python function call controller

How to use

Install

pip3 install throttle

Usage

from throttle import task


# two consequence foo calling own at least 0.1 second interval
@task(min_interval=0.1)
def foo(*args, **kwargs):
    print(args, kwargs)


foo(1, 2, 3)

How it works

throttle builds a tiny local socket network with master-slave topology.

So any call of registered function is controller by the master node's controller algorithm.

Controller

  • MinIntervalController
  • MockController

TODOs

  • Take dynamic local network construction and high availability into consideration
  • More control algorithm choices

About author

zhenninglang@163.com

Release files for fn-throttle 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fn-throttle 0.0.1
File Size Uploaded
fn-throttle-0.0.1.tar.gz 5.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fn-throttle 0.0.1
File Interpreter ABI Platform
fn_throttle-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.2 kB

Release files / fn-throttle-0.0.1.tar.gz

Download URL fn-throttle-0.0.1.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
87c6c1d5cd0ae00b324e595a947caf315fac4674bd2b630bf33f4cdfeb00ce3f
BLAKE2b-256 checksum
How to use checksums
460b28b883fabd72c28c1208ca064ad07a2b97553fd78d00a4cdfaaf7a2319f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.13.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

Release files / fn_throttle-0.0.1-py3-none-any.whl

Download URL fn_throttle-0.0.1-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e068a91dd125c7025dc0b6907b53423d834691f8c07a790baa893e197c14f8b6
BLAKE2b-256 checksum
How to use checksums
549b416289eec86d9273a3acef04ad4de46f36845d6ca4dd06021625ab3ce43d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.13.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page