Method: Magent::GenericChannel#next_message

Defined in:
lib/magent/generic_channel.rb

#next_messageObject



31
32
33
34
# File 'lib/magent/generic_channel.rb', line 31

def next_message
  collection.find_and_modify(:sort => [[:priority, Mongo::ASCENDING], [:created_at, Mongo::DESCENDING]],
                             :remove => true) rescue {}
end