Sha256: cf463f4a85770368c7899d9e5cae6aac5f37450ee7794ebb4830fa78da44afb9
Contents?: true
Size: 743 Bytes
Versions: 17
Compression:
Stored size: 743 Bytes
Contents
class Freddy class RequestManager def initialize(logger) @requests = ConcurrentHash.new @logger = logger end def no_route(correlation_id) if request = @requests[correlation_id] delete(correlation_id) request[:callback].call({error: 'Specified queue does not exist'}, nil) end end def store(correlation_id, opts) @requests[correlation_id] = opts end def delete(correlation_id) @requests.delete(correlation_id) end class ConcurrentHash < Hash # CRuby hash does not need any locks. Only adding when using JRuby. if RUBY_PLATFORM == 'java' require 'jruby/synchronized' include JRuby::Synchronized end end end end
Version data entries
17 entries across 17 versions & 2 rubygems