Skip to main content

Standalone python function call controller

Project description

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

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

fn-throttle-0.0.1.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fn_throttle-0.0.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file fn-throttle-0.0.1.tar.gz.

File metadata

  • Download URL: fn-throttle-0.0.1.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for fn-throttle-0.0.1.tar.gz
Algorithm Hash digest
SHA256 87c6c1d5cd0ae00b324e595a947caf315fac4674bd2b630bf33f4cdfeb00ce3f
MD5 570992c0f40d14ec036545465dd5cbcb
BLAKE2b-256 460b28b883fabd72c28c1208ca064ad07a2b97553fd78d00a4cdfaaf7a2319f5

See more details on using hashes here.

File details

Details for the file fn_throttle-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: fn_throttle-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for fn_throttle-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e068a91dd125c7025dc0b6907b53423d834691f8c07a790baa893e197c14f8b6
MD5 3bd4b1a69e494aa5245197fba4904463
BLAKE2b-256 549b416289eec86d9273a3acef04ad4de46f36845d6ca4dd06021625ab3ce43d

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