Giter VIP home page Giter VIP logo

ratelimiter's Introduction

限流器

本项目代码旨在限制对某个函数同一时刻对运行数量,同时支持对任务执行情况的查询处理,以及多回调函数的附加处理

基本原理是通过信号量与线程池进行控制

场景示例

算法服务通常需要大量的算力,在算力受限的情况下,如果无法优化模型的算力需求,则只能通过异步限流的形式对服务进行调用

本项目可以控制需要限流的函数,也可以统一对不需要限流的函数进行处理

安装说明

将项目中的ratelimiter.py复制到项目的文件夹下,通过包的引用加载即可

后续会将其打包成一个pypi进行分发

使用说明

基础使用可见/test/test_rate_limiter.py中的使用

联系我

qq: 2781939070

wechat: 2781939070

ratelimiter's People

Contributors

oslijunw avatar

Stargazers

faker avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.