Class: Isimud::Client Abstract
Overview
This class is abstract.
Messaging queue service client
Direct Known Subclasses
Instance Method Summary collapse
- #bind(queue_name, exchange_name, *keys, &method) ⇒ Object
- #channel ⇒ Object
- #close ⇒ Object
- #connect ⇒ Object
- #connected? ⇒ Boolean
- #create_queue(queue_name, exchange_name, options = {}) ⇒ Object
- #delete_queue(queue_name) ⇒ Object
- #find_queue(queue_name, options = {}) ⇒ Object
-
#initialize(server = nil, options = nil) ⇒ Client
constructor
A new instance of Client.
-
#on_exception {|e| ... } ⇒ Object
Declare a proc to be run whenever an uncaught exception is raised within a message processing block.
- #publish(exchange, routing_key, payload, options) ⇒ Object
- #reconnect ⇒ Object
- #reset ⇒ Object
-
#run_exception_handlers(exception) ⇒ Boolean
Call each of the exception handlers declared by #on_exception.
- #subscribe(queue, options = {}, &block) ⇒ Object
Methods included from Logging
Constructor Details
#initialize(server = nil, options = nil) ⇒ Client
Returns a new instance of Client.
6 7 |
# File 'lib/isimud/client.rb', line 6 def initialize(server = nil, = nil) end |
Instance Method Details
#bind(queue_name, exchange_name, *keys, &method) ⇒ Object
9 10 |
# File 'lib/isimud/client.rb', line 9 def bind(queue_name, exchange_name, *keys, &method) end |
#channel ⇒ Object
12 13 |
# File 'lib/isimud/client.rb', line 12 def channel end |
#close ⇒ Object
15 16 |
# File 'lib/isimud/client.rb', line 15 def close end |
#connect ⇒ Object
18 19 |
# File 'lib/isimud/client.rb', line 18 def connect end |
#connected? ⇒ Boolean
21 22 |
# File 'lib/isimud/client.rb', line 21 def connected? end |
#create_queue(queue_name, exchange_name, options = {}) ⇒ Object
24 25 |
# File 'lib/isimud/client.rb', line 24 def create_queue(queue_name, exchange_name, = {}) end |
#delete_queue(queue_name) ⇒ Object
27 28 |
# File 'lib/isimud/client.rb', line 27 def delete_queue(queue_name) end |
#find_queue(queue_name, options = {}) ⇒ Object
30 31 |
# File 'lib/isimud/client.rb', line 30 def find_queue(queue_name, = {}) end |
#on_exception {|e| ... } ⇒ Object
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.
36 37 38 |
# File 'lib/isimud/client.rb', line 36 def on_exception(&block) exception_handlers << block end |
#publish(exchange, routing_key, payload, options) ⇒ Object
55 56 |
# File 'lib/isimud/client.rb', line 55 def publish(exchange, routing_key, payload, ) end |
#reconnect ⇒ Object
58 59 |
# File 'lib/isimud/client.rb', line 58 def reconnect end |
#reset ⇒ Object
61 62 |
# File 'lib/isimud/client.rb', line 61 def reset end |
#run_exception_handlers(exception) ⇒ Boolean
Call each of the exception handlers declared by #on_exception.
43 44 45 46 47 48 49 50 51 52 53 |
# 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) ⇒ Object
64 65 |
# File 'lib/isimud/client.rb', line 64 def subscribe(queue, = {}, &block) end |