Giter Site home page Giter Site logo

Comments (2)

gammazero avatar gammazero commented on August 21, 2024

Being a non-blocking queue it will allow the caller to continue submitting tasks up to the limit of the memory. When using WorkerPool if there is a chance of submitting more tasks that can be safely stored in memory, then there should be some means (outside of workerpool) to stop submitting tasks before this limit.

A modified WorkerPool could be given a limit to the number of queued tasks it will enqueue and then handle additional submissions by blocking or by discarding tasks. The reason that WorkerPool does not handle this is that these functionalities can be added by the caller, and how they are handled are likely application-specific.

In the case of the blocking queue, the application can determine when it is in a low-resource condition and then stop submitting new tasks while the condition persists. Or, if limiting the queued tasks, can stop submitting more until the number of incomplete tasks decreases.

In the case of discarding, what to discard is going to be up to the application (oldest, random, lowest priority, etc.) The task function itself, or a task function wrapper, would check the discard condition and exit immediately if it is discarded, possibly sending a notification that it was discarded.

from workerpool.

Prince-Hervoet avatar Prince-Hervoet commented on August 21, 2024

ok,thanks

from workerpool.

Related Issues (20)

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.