class DispatchRider::QueueServices::FileSystem
Public Instance Methods
assign_storage(attrs)
click to toggle source
# File lib/dispatch-rider/queue_services/file_system.rb, line 12 def assign_storage(attrs) path = attrs.fetch(:path) Queue.new(path) rescue IndexError raise RecordInvalid.new(self, ["Path can not be blank"]) end
construct_message_from(item)
click to toggle source
# File lib/dispatch-rider/queue_services/file_system.rb, line 31 def construct_message_from(item) deserialize(item.read) end
delete(item)
click to toggle source
# File lib/dispatch-rider/queue_services/file_system.rb, line 37 def delete(item) queue.remove item end
insert(item)
click to toggle source
# File lib/dispatch-rider/queue_services/file_system.rb, line 19 def insert(item) queue.add item end
raw_head()
click to toggle source
# File lib/dispatch-rider/queue_services/file_system.rb, line 23 def raw_head queue.pop end
received_message_for(raw_item)
click to toggle source
# File lib/dispatch-rider/queue_services/file_system.rb, line 27 def received_message_for(raw_item) FsReceivedMessage.new(construct_message_from(raw_item), raw_item, queue) end