GithubHelp home page GithubHelp logo

Comments (4)

markokr avatar markokr commented on July 28, 2024

The current logic is based on following assumptions:

  • There are always new events incoming in busy database
  • If there are many consumers, you don't want them all coming in at the same time. So such random separation that the sleep() creates is good.

Could you describe why the sleep() loop is unsatisfactory for your situation?

from skytools-legacy.

ocharles avatar ocharles commented on July 28, 2024

Hmm, I guess I have no real justification other than finding blocking for an event cleaner - it saves me a bit of CPU, and a bit of network activity to do the poll myself.

In terms of the first point, that doesn't apply to me (yet) because my database is very low on writes, and it's writes that currently trigger PgQ events. I can appreciate the second point, but I only have a single consumer for now, so I hadn't considered that.

That said, even having notifications doesn't mean you have to actually use them :)

from skytools-legacy.

markokr avatar markokr commented on July 28, 2024

Although the amount of code to be added on ticker side is small, it still feels wrong to optimize for idle system.

And note that it's easy change on ticker side, but it gets more complex on consumer side - how do they know whether to listen for notification or not? And if the queue setting changes, how do they follow it?

And all consuming libraries need to be changed with the logic.

So it does seem simpler to avoid notifications, and on idle system you can simply tune timeouts to decrease the noise level.

from skytools-legacy.

ocharles avatar ocharles commented on July 28, 2024

I don't have any further arguments, so I'll trust your judgement that the correct logic is for the best. Thanks for discussing this with me!

from skytools-legacy.

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.