Giter Site home page Giter Site logo

Clear tasks in queue about better-queue HOT 4 CLOSED

karmac2015 avatar karmac2015 commented on July 22, 2024
Clear tasks in queue

from better-queue.

Comments (4)

karmac2015 avatar karmac2015 commented on July 22, 2024 1

Your library is good but after using it , I think it is better to provide a way that allows developers to access tickets and workers inside queue, so they can remove tickets and manage workers. There is no full control on tasks that pushed to queue.

from better-queue.

leanderlee avatar leanderlee commented on July 22, 2024

I guess you can make a custom store to do this... It should be fairly trivial to extend the store to include it, but it’s not included in better queue stores currently.

from better-queue.

leanderlee avatar leanderlee commented on July 22, 2024

I am not actively developing this project anymore, but would be happy to accept contributions to keep it going. Please feel free to propose and make the necessary changes so our community can benefit from this!

from better-queue.

crushjz avatar crushjz commented on July 22, 2024

You can clear the queue by calling queue.cancel(taskId) for each of the remaining tasks.
The downside is that you have to keep the ids of the tasks and their status somewhere.

eg:

const abortQueue = (tasksToStop: string[]): void => {
  tasksToStop.forEach(taskId => {
    queue.cancel(taskId)
  })
}

from better-queue.

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.