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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page