Module: ErrbitZmqHandler

Defined in:
lib/errbit_zmq_handler.rb,
lib/errbit_zmq_handler/handler.rb,
lib/errbit_zmq_handler/version.rb,
lib/errbit_zmq_handler/configuration.rb

Defined Under Namespace

Classes: Configuration, Handler

Constant Summary collapse

VERSION =
"1.0.0"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject

A Errbit ZMQ Handler configuration object. Must act like a hash and return sensible values for all Hoptoad ZMQ configuration options. See ErrbitZmqHandler::Configuration.



12
13
14
# File 'lib/errbit_zmq_handler.rb', line 12

def configuration
  @configuration
end

Class Method Details

.configure {|configuration| ... } ⇒ Object

Call this method to modify defaults in your initializers.

Examples:

ErrbitZmqHandler.configure do |config|
  config.mailbox_size = 1000
  config.uri  = 'tcp://errbit.home:9999'
end

Yields:



21
22
23
24
# File 'lib/errbit_zmq_handler.rb', line 21

def configure
  self.configuration ||= Configuration.new
  yield(configuration)
end

.handlerObject

The handler object is responsible for delivering formatted data to the Hoptoad server. Must respond to #start!. See ErrbitZmqHandler::Handler.



28
29
30
# File 'lib/errbit_zmq_handler.rb', line 28

def handler
  @handler ||= Handler.new.tap {|h| h.uri = ErrbitZmqHandler.configuration.uri}
end