'Called by our callback handler when we receive a Channel.OpenOk and
subsequently calls our _on_openok_callback which was passed into the
Channel constructor. The reason we do this is because we want to make
sure that the on_open_callback parameter passed into the Channel
constructor is not the first callback we make.
Suppress the state transition and callback if channel is already in
CLOSING state.
:param pika.frame.Method method_frame: Channel.OpenOk frame'

def _on_openok(self, method_frame):

    if self.is_closing:
        LOGGER.debug('Suppressing    while    in    closing    state:    %s', method_frame)
    else:
        self._set_state(self.OPEN)
        if (self._on_openok_callback is not None):
            self._on_openok_callback(self)
