lib/grumlin/client.rb
def close(check_requests: true) # rubocop:disable Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
      return if @closed

      @closed = true

      @transport&.close
      @transport&.wait

      @response_task&.stop
      @response_task&.wait

      return if @request_dispatcher&.requests&.empty?

      @request_dispatcher.clear unless check_requests

      raise ResourceLeakError, "Request list is not empty: #{@request_dispatcher.requests}" if check_requests
    ensure
      logger.debug(self, "Closed")
    end
# Before calling close the user must ensure that:
# 1) There are no ongoing requests
# 2) There will be no new writes after
Before calling close the user must ensure that:
1) There are no ongoing requests
2) There will be no new writes after
Before calling close the user must ensure that : 1 ) There are no ongoing requests 2 ) There will be no new writes after
def close(check_requests: true) 
      return if @closed
      @closed = true
      @transport&.close
      @transport&.wait
      @response_task&.stop
      @response_task&.wait
      return if @request_dispatcher&.requests&.empty?
      @request_dispatcher.clear unless check_requests
      raise ResourceLeakError, "Request list is not empty: #{@request_dispatcher.requests}" if check_requests
    ensure
      logger.debug(self, "Closed")
    end
def close ( check_requests : true ) return if @closed @closed = true @transport &. close @transport &. wait @response_task &. stop @response_task &. wait return if @request_dispatcher &. requests &. empty? @request_dispatcher . clear unless check_requests raise ResourceLeakError , "Request list is not empty: #{@request_dispatcher.requests}" if check_requests ensure logger . debug ( self , "Closed" ) end
Before calling close the user must ensure that:
1) There are no ongoing requests
2) There will be no new writes after
Before calling close the user must ensure that : 1 ) There are no ongoing requests 2 ) There will be no new writes after
# rubocop:disable Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
check_requests