mosquito-cr / mosquito

A background task runner for crystal applications supporting periodic (CRON) and manually queued jobs
MIT License
227 stars 24 forks source link

Address developer experience around Job#job_type #84

Closed robacarp closed 2 years ago

robacarp commented 2 years ago

The current implementation for how to specify which queues a job should land in is opaque:

class GeneratorJob < QueuedJob
   def self.job_type
     "generator"
  end

  # ...etc
end

Should Job#job_type be renamed? Should a macro be provided to make that feature less verbose? At a minimum documentation should be added to the method so it's clear what it's supposed to do.

see https://github.com/mosquito-cr/mosquito/issues/80#issuecomment-1039006927