def wait_for_service(service_name, timeout_sec)
      begin
        timeout(timeout_sec) do
          while @is_ok
            if @master.lookup_service(service_name)
              return true
            end
            sleep(0.1)
          end
        end
      rescue Timeout::Error
        puts "time out for wait service #{service_name}"
        return nil
      rescue
        raise "connection with master failed. master = #{@master_uri}"
      end
    end
def wait_for_service(service_name, timeout_sec)
      begin
        timeout(timeout_sec) do
          while @is_ok
            if @master.lookup_service(service_name)
              return true
            end
            sleep(0.1)
          end
        end
      rescue Timeout::Error
        puts "time out for wait service #{service_name}"
        return nil
      rescue
        raise "connection with master failed. master = #{@master_uri}"
      end
    end
wait until service is available
 @param [String] service_name name of service for waiting
 @param [Float] timeout_sec wait for this seconds, then time out
 @return [Boolean] true: available, false: time out