def dispatch(method, *args, &block)
      if @safe_mode && !recently_heard_from_node_manager?
        build_clients
      end

      verify_supported!(method)
      tries = 0
      begin
        client_for(method).send(method, *args, &block)
      rescue *CONNECTIVITY_ERRORS => ex
        logger.error("Error while handling `#{method}` - #{ex.inspect}")
        logger.error(ex.backtrace.join("\n"))

        if tries < @max_retries
          tries += 1
          free_client
          build_clients
          sleep(RETRY_WAIT_TIME)
          retry
        end
        raise
      ensure
        free_client
      end
    end
def dispatch(method, *args, &block)
      if @safe_mode && !recently_heard_from_node_manager?
        build_clients
      end

      verify_supported!(method)
      tries = 0
      begin
        client_for(method).send(method, *args, &block)
      rescue *CONNECTIVITY_ERRORS => ex
        logger.error("Error while handling `#{method}` - #{ex.inspect}")
        logger.error(ex.backtrace.join("\n"))

        if tries < @max_retries
          tries += 1
          free_client
          build_clients
          sleep(RETRY_WAIT_TIME)
          retry
        end
        raise
      ensure
        free_client
      end
    end
Dispatches a redis operation to a master or slave.

 @param [Symbol] method the method to dispatch
 @param [Array] args the arguments to pass to the method
 @param [Proc] block an optional block to pass to the method
 @return [Object] the result of dispatching the command