Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@npj
Created May 19, 2012 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save npj/2731680 to your computer and use it in GitHub Desktop.
Save npj/2731680 to your computer and use it in GitHub Desktop.
# app/models/queue/base.rb
class Queue::Base
class << self
def enqueue(object, method, *args)
# ...to be continued
end
def perform
# ...to be continued
end
end
end
# app/models/queue/high.rb
class Queue::High < Queue::Base
@queue = :high
end
# app/models/queue/normal.rb
class Queue::Normal < Queue::Base
@queue = :normal
end
# app/models/queue/low.rb
class Queue::Low < Queue::Base
@queue = :low
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment