def set_max_in_flight(self, max_in_flight):
        """dynamically adjust the reader max_in_flight count. Set to 0 to immediately disable a Reader"""
        assert isinstance(max_in_flight, int)
        self.max_in_flight = max_in_flight
        
        if max_in_flight == 0:
            # set RDY 0 to all connections
            for conn in self.conns.itervalues():
                if conn.rdy > 0:
                    logger.debug('[%s:%s] rdy: %d -> 0', conn.id, self.name, conn.rdy)
                    self._send_rdy(conn, 0)
            self.total_rdy = 0
        else:
            self.need_rdy_redistributed = True
            self._redistribute_rdy_state()
dataset/ETHPy150Open nsqio/pynsq/nsq/reader.py/Reader.set_max_in_flight/original