mardi 7 novembre 2023

Is there a “proper” name for the “delayed job” pattern?

There’s a general pattern in web development where an app server offloads asynchronous or long-running tasks to a task queue (see e.g Celery for Python or Resque for Ruby). These tasks then get picked up by a set of worker processes via a message queue. What sets these apart from other queue systems is that:

  • The worker nodes are often running the same code as the app server (in a general message queue / pub sub system this doesn’t have to be the case)
  • Serialization is often handled behind an interface; usually you can turn a regular method or object into a task using inheritance or meta programming
  • Given the properties above, you can usually short-circuit the message queue and run the tasks synchronously (eg for unit testing)

Is there a name for this specific type of queue / worker pattern that sets it apart from the more general concept of a task queue?

Aucun commentaire:

Enregistrer un commentaire