Giter Site home page Giter Site logo

Comments (5)

retorquere avatar retorquere commented on July 22, 2024 1

Wouldn't this be solved by having your callback just use setTimeout to trigger the actual action and callback?

from better-queue.

retorquere avatar retorquere commented on July 22, 2024 1

I could see why that would be an issue, but how else do you want to create a delay if no by using settimeout? I mean you could use two queues, the primary having a afterProcessDelay of one minute, and have tasks on that queue put tasks on a secondary queue, but I'm betting better-queue uses (something like) setTimeout for afterProcessDelay, so it really wouldn't help.

Why do you need to have these events held for a minute BTW? Is it to collapse events? I use cancelIfRunning: true for that (or merge could be used similarly). If it's just to pace things out, you could use a paused queue and have a setTimer activate the queue only once a minute

But with these kind of volumes, you may want to look at something like a redis-backed queue. I'd need to know more about your specific use-case.

from better-queue.

dungvu-novus avatar dungvu-novus commented on July 22, 2024

You could not use setTimeout for 100K-300K event in flash time (10-15s) in coming. So I try to use queue to reproduce and persistent the data.

from better-queue.

dungvu-novus avatar dungvu-novus commented on July 22, 2024

even you could handle the big events, there no memory to delay 1 minute or more time period. That in my stress test, but in the production (~100k per minute) there is not good idea.

from better-queue.

dungvu-novus avatar dungvu-novus commented on July 22, 2024

yep, I looking for db-based queue like mongo or redis for persistent big data amounts. But sadly my project is too small and so hard to add new db system :(
I find this lib that use sqllite in 1 file for backed storage, so I try to use this lib, but as your advice, there is no the good ideal. Could you have some ideal for this.
Thanks,

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.