Coder Social home page Coder Social logo

Comments (2)

generals-space avatar generals-space commented on July 19, 2024

你好, 我想你想要的是类似于threadpool库的wait()函数.

我最终也没有找到一个比较官方的方法, 但是我觉得这个需求其实很合理, 目前只能用一个比较 hack 的方式, 可以见我最新代码中07.限制协程并发数量-semaphore/task_pool_fix.py文件. 执行完毕时可以自动结束(不知道会有什么样的bug...)

...
order 44: {'delay': 24}
order 45: {'delay': 26}
order 49: {'delay': 15}
order 47: {'delay': 21}
order 48: {'delay': 19}
customer complete...
主线程结束...

from pyasync.

xiefei99 avatar xiefei99 commented on July 19, 2024

楼主写的很好,但是现在出了3.10版本了,楼主之前写的文章python的语法都用不上了, 或许需要学习的同学可以移步到python官方文档学习,每个版本使用的函数都不一样,所以尽量挑自己的版本进行学习。

from pyasync.

Related Issues (1)

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.