redibox / job

High performance, robust and flexible queue/worker system powered by redis.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove loggers and add lifecycle events for jobs

Salakar opened this issue · comments

At the moment we've added logging for processes running in Kubernetes pods everywhere, for creation, completion and failures of jobs. Instead this should be down to the user to add - to do this we need to add in lifecycle events for jobs, I propose the following:

  • beforeCreate
    • async with callback - return original job or modified job.
  • afterCreate
    • Just plain events, no interaction with jobs.
  • onSuccess
    • Just plain events, no interaction with jobs.
  • onRelayCancelled
    • Just plain events, no interaction with jobs.
  • onRetry
    • Just plain events, no interaction with jobs.
  • onFailure
    • Just plain events, no interaction with jobs.

Hook lifecycle events:

  • beforeCreate
  • afterCreate
  • onJobSuccess
  • onJobFailure
  • onRelayStepSuccess
  • onRelayStepCancelled
  • onJobRetry

Job events:

  • onSuccess
  • onFailure
  • onRetry
  • onRelayStepSuccess
  • onRelayStepCancelled