Sha256: 8c49cd735a6e480678252fcd30ee490e3ce29542cda31787229f8d5c4b82905c

Contents?: true

Size: 745 Bytes

Versions: 2

Compression:

Stored size: 745 Bytes

Contents

module DispatchRider
  module QueueServices
    class FileSystem < Base
      class FsReceivedMessage < ReceivedMessage
        attr_reader :queue
        
        def initialize(message, item, queue)
          @queue = queue
          super(message, item)
        end
        
        def extend_timeout(timeout)
          #file system doesn't support timeouts on items, so we ignore this.
        end
        
        def return_to_queue
          queue.put_back(item)
        end

        def receive_count
          1 # can't really check that in this service
        end

        def sent_at
          @item.ctime
        end

        def queue_name
          File.basename(File.dirname(@item.path))
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dispatch-rider-2.1.0 lib/dispatch-rider/queue_services/file_system/fs_received_message.rb
dispatch-rider-2.0.0 lib/dispatch-rider/queue_services/file_system/fs_received_message.rb