lml / lev

Ride the rails but don't touch them.
MIT License
2 stars 6 forks source link

Add ruby 2.x support, ActiveJobStatus support #23

Closed joemsak closed 9 years ago

joemsak commented 9 years ago

Need ActiveJobStatus to be able to query the status of jobs for the JS UI/UX

Need ruby 2.x support to use this gem

Need to use byebug on ruby 2.x instead of debugger

jpslav commented 9 years ago

I'm a little hesitant to push lev to 2.x since Accounts uses it and is on 1.9. Also, active_job_status looks like the very definition of bleeding edge, not to a stable version yet, little used/watched, etc. No other alternatives?

Tutor comment here: Instead of the FE querying the status, can our DistributeTasks job instead update the state of the TaskPlan (from unpublished to publishing to published or publish_failed)? Then the FE wouldn't need to query the job itself and could just do what it does now, query the TaskPlan?

If we really need this gem to be supported (and please explain why if so), I think the less intrusive approach w.r.t. Lev is to let the ActiveJob class be configurable, and to pull in all the ActiveJobStatus stuff from Tutor, e.g.

# inside Tutor
Lev.configure do |config|
  config.active_job_class = TrackableJob
end

and then use this inside routine.rb:

Class.new(Lev.configuration.active_job_class) do
  queue_as do
joemsak commented 9 years ago

Solid idea, for sure. However, what about the case where I am exporting the performance book? There is no db record to update an attribute on. Should the 'export' status checker just look for a new file in some way?