Hermes Wiki

Command

Encapsulates a request (an action plus its arguments) as an object, decoupling the code that invokes an action from the code that performs it.

Why we need this / what value this brings

Decouples the invoker from the receiver, and turns an action into a first-class object that can be queued, logged, undone, or retried.

When to use this

You need to queue, delay, log, retry, or undo actions rather than executing them immediately and directly.

How to use or implement this

Define a common interface (e.g. execute()) implemented by one class per action, and have the invoker hold/call commands without knowing their concrete type.

Research questions

  • Background job dispatch (booking reminders, payment retries) already looks command-shaped — worth checking whether the current task-queue code models each job as an explicit command object or just a function reference.

Empty folder — drop notes, links, and findings here as you research.

Hermes Wiki