class Isimud::Client

@abstract Messaging queue service client

Public Class Methods

new(server = nil, options = nil) click to toggle source
# File lib/isimud/client.rb, line 6
def initialize(server = nil, options = nil)
end

Public Instance Methods

bind(queue_name, exchange_name, *keys, &method) click to toggle source
# File lib/isimud/client.rb, line 9
def bind(queue_name, exchange_name, *keys, &method)
end
channel() click to toggle source
# File lib/isimud/client.rb, line 12
def channel
end
close() click to toggle source
# File lib/isimud/client.rb, line 15
def close
end
connect() click to toggle source
# File lib/isimud/client.rb, line 18
def connect
end
connected?() click to toggle source
# File lib/isimud/client.rb, line 21
def connected?
end
create_queue(queue_name, exchange_name, options = {}) click to toggle source
# File lib/isimud/client.rb, line 24
def create_queue(queue_name, exchange_name, options = {})
end
delete_queue(queue_name) click to toggle source
# File lib/isimud/client.rb, line 27
def delete_queue(queue_name)
end
find_queue(queue_name, options = {}) click to toggle source
# File lib/isimud/client.rb, line 30
def find_queue(queue_name, options = {})
end
on_exception(&block) click to toggle source

Declare a proc to be run whenever an uncaught exception is raised within a message processing block. This is useful for logging or monitoring errors, for instance. @yieldparam [Exception] e exception raised

# File lib/isimud/client.rb, line 36
def on_exception(&block)
  exception_handlers << block
end
publish(exchange, routing_key, payload, options) click to toggle source
# File lib/isimud/client.rb, line 55
def publish(exchange, routing_key, payload, options)
end
reconnect() click to toggle source
# File lib/isimud/client.rb, line 58
def reconnect
end
reset() click to toggle source
# File lib/isimud/client.rb, line 61
def reset
end
run_exception_handlers(exception) click to toggle source

Call each of the exception handlers declared by on_exception. @param [Exception] exception @return [Boolean] true if message should be requeued, false otherwise

# File lib/isimud/client.rb, line 43
def run_exception_handlers(exception)
  status = true
  exception_handlers.each do |handler|
    status &&= begin
      handler.call(exception)
    rescue
      nil
    end
  end
  Isimud.retry_failures.nil? ? status : Isimud.retry_failures
end
subscribe(queue, options = {}, &block) click to toggle source
# File lib/isimud/client.rb, line 64
def subscribe(queue, options = {}, &block)
end

Private Instance Methods

exception_handlers() click to toggle source
# File lib/isimud/client.rb, line 69
def exception_handlers
  @exception_handlers ||= Array.new
end