Git Product home page Git Product logo

Comments (5)

pwalsh avatar pwalsh commented on May 24, 2024 1

@noamoss in our context, queuing systems are used to manage asynchronous jobs that do not need (for various types of "need" - performance, application semantics, etc.) to be dispatched and returned in the request/response cycle of a web app.

Dispatching emails is a classic example of this. Dispatching them in a request/response cycle means the web app has more processing to do before it can respond back to the client (especially true in languages like python).

So, what is commonly done is to dispatch a "job" (a job might be a function and its arguments), put it "somewhere", and call it "later", allowing the response to return without calling the job. This design has additional benefits like the ability to retry the job if there is a failure, to set dependencies across jobs etc.

In GovFlow, because Node is an event-driven web server (it is asynchronous by design), we do the "dispatch" part using some node functionality, but, we don't get the benefit of the ability to re-run jobs, inspect job health, etc.

A concrete example is, if we try to dispatch an email and the receiving server is temporarily down, we don't know and we can't try again later.

A job queue will allow us to manage such tasks, which run run the background of the web server, more robustly.

from govflow.

pwalsh avatar pwalsh commented on May 24, 2024 1

@noamoss @amirozer I looked into it last week and it seems this is probably the best solution for this in node:

https://github.com/OptimalBits/bull

@amirozer if you have other choices that are in use, let me know.

from govflow.

noamoss avatar noamoss commented on May 24, 2024

@pwalsh not sure I understand the core of this issue, can you elaborate a bit?

from govflow.

pwalsh avatar pwalsh commented on May 24, 2024

So, SendGrid has a send_at functionality - and it turns out that Twilio does too. This basically solves our whole issue:

  • we dont need to manage our own queue or schedule - they do it
  • we just dispatch message tasks to those backends as we normally do
  • we do need to update our communication model like in the previous comment to ensure we are tracking what got send properly (enough), and save some rendered message data for potential debugging purposes

from govflow.

pwalsh avatar pwalsh commented on May 24, 2024

This is now done in ba32772 by using the functionality of our service providers Twilio and SendGrid.

from govflow.

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.