def register_handler(queues, *args, &block)
      queues = determine_queue_names(Array(queues))
      opts = args.last.is_a?(Hash) ? args.pop : {}
      handler = args.shift
      raise ArgumentError.new("too many arguments for handler registration") unless args.empty?
      subscriber.register_handler(queues, opts, handler, &block)
    end
def register_handler(queues, *args, &block)
      queues = determine_queue_names(Array(queues))
      opts = args.last.is_a?(Hash) ? args.pop : {}
      handler = args.shift
      raise ArgumentError.new("too many arguments for handler registration") unless args.empty?
      subscriber.register_handler(queues, opts, handler, &block)
    end
registers a handler for a list of queues (which must have been registered
 previously). The handler will be invoked when any messages arrive on the queue.

 Examples:
   register_handler([:foo, :bar], :timeout => 10.seconds) { |message| puts "received #{message}" }

   on_error   = lambda{ puts "something went wrong with baz" }
   on_failure = lambda{ puts "baz has finally failed" }

   register_handler(:baz, :exceptions => 1, :errback => on_error, :failback => on_failure) { puts "received baz" }

   register_handler(:bar, BarHandler)

 For details on handler classes see class Beetle::Handler