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

Change the params api #50

Closed watzon closed 4 years ago

watzon commented 4 years ago

It would be nice if you could just pass the params you want directly into the perform method. Basically take the api from:

class MyWorker < Mosquito::QueuedJob
  params(param_one : String, other : String)

  def perform
  # ...
  end
end

to

class MyWorker < Mosquito::QueuedJob
  def perform(param_one : String, other : String)
  # ...
  end
end

Just a way to simplify the API a bit.

robacarp commented 4 years ago

This isn't a bad idea, but I don't think it creates enough benefit to warrant the breaking change that it would cause to the API. Perhaps for version 1.0, after Crystal 1.0 arrives.