def _cb_tune(self, method):
        args = method.args
        client_heartbeat = self._heartbeat_client or 0
        # maximum number of channels that the server supports
        self.channel_max = min(args.read_short(), self.channel_max)
        # largest frame size the server proposes for the connection
        self.frame_max = min(args.read_long(), self.frame_max)
        self.method_writer.frame_max = self.frame_max
        # heartbeat interval proposed by server
        self._heartbeat_server = args.read_short() or 0

        # negotiate the heartbeat interval to the smaller of the specified values
        if self._heartbeat_server == 0 or client_heartbeat == 0:
            self._heartbeat_final = max(self._heartbeat_server, client_heartbeat)
        else:
            self._heartbeat_final = min(self._heartbeat_server, client_heartbeat)

        # Ignore server heartbeat if client_heartbeat is disabled
        if not self._heartbeat_client:
            self._heartbeat_final = 0

        self._send_tune_ok(self.channel_max, self.frame_max, self._heartbeat_final)
Add a listener for extensions being added/removed.
dataset/ETHPy150Open veegee/amqpy/amqpy/connection.py/Connection._cb_tune--crossover with--dataset/ETHPy150Open enthought/envisage/envisage/application.py/Application.add_extension_point_listener