module DBQ::BasicQueue

Public Class Methods

included(receiver) click to toggle source
# File lib/dbq/basic_queue.rb, line 3
def self.included(receiver)
  receiver.after_rollback :check_in!
  receiver.extend ClassMethods
end

Public Instance Methods

check_in!() click to toggle source
# File lib/dbq/basic_queue.rb, line 34
def check_in!
  # necessary if we were frozen by a rolled back destroy call
  self.class.update(id, checked_out_at: nil)
end
check_out!() click to toggle source
# File lib/dbq/basic_queue.rb, line 30
def check_out!
  self.update_attributes(checked_out_at: Time.now)
end
data() click to toggle source
# File lib/dbq/basic_queue.rb, line 44
def data
  wrapped_data['data'] if wrapped_data
end
data=(new_data) click to toggle source
# File lib/dbq/basic_queue.rb, line 39
def data=(new_data)
  self.wrapped_data ||= {}
  wrapped_data['data'] = new_data
end