Sha256: fb3e881e3c0713acbb5e9f85165f9b601bd0c35a0fcba69895cbc23908956cdf

Contents?: true

Size: 541 Bytes

Versions: 15

Compression:

Stored size: 541 Bytes

Contents

# frozen_string_literal: true

class Freddy
  class RequestManager
    def initialize(logger)
      @requests = {}
      @logger = logger
    end

    def no_route(correlation_id)
      request = @requests[correlation_id]
      return unless request

      delete(correlation_id)
      request[:callback].call({ error: 'Specified queue does not exist' }, nil)
    end

    def store(correlation_id, opts)
      @requests[correlation_id] = opts
    end

    def delete(correlation_id)
      @requests.delete(correlation_id)
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
freddy-2.8.0 lib/freddy/request_manager.rb
freddy-2.7.0 lib/freddy/request_manager.rb
freddy-2.6.0 lib/freddy/request_manager.rb
freddy-2.5.1 lib/freddy/request_manager.rb
freddy-2.5.0 lib/freddy/request_manager.rb
freddy-2.5.0.pre.rc.1 lib/freddy/request_manager.rb
freddy-2.4.0 lib/freddy/request_manager.rb
freddy-2.3.0 lib/freddy/request_manager.rb
freddy-2.2.4 lib/freddy/request_manager.rb
freddy-2.2.3 lib/freddy/request_manager.rb
freddy-2.2.2 lib/freddy/request_manager.rb
freddy-2.2.1 lib/freddy/request_manager.rb
freddy-2.2.0 lib/freddy/request_manager.rb
freddy-2.1.0 lib/freddy/request_manager.rb
freddy-2.0.0 lib/freddy/request_manager.rb