def set_max_in_flight(self, max_in_flight):
assert isinstance(max_in_flight, int)<EOL>self.max_in_flight = max_in_flight<EOL>if max_in_flight == <NUM_LIT:0>:<EOL><INDENT>for conn in itervalues(self.conns):<EOL><INDENT>if conn.rdy > <NUM_LIT:0>:<EOL><INDENT>logger.debug('<STR_LIT>', conn.id, self.name, conn.rdy)<EOL>self._send_rdy(conn, <NUM_LIT:0>)<EOL><DEDENT><DEDENT>self.total_rdy = <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>self.need_rdy_redistributed = True<EOL>self._redistribute_rdy_state()<EOL><DEDENT>
Dynamically adjust the reader max_in_flight. Set to 0 to immediately disable a Reader