(cls, session)
This is a non-blocking acquire.

        The session that claims a channel must also release it when it's over.
        Returns True if it was able to claim the channel.
This is a non-blocking acquire.
This is a non - blocking acquire .
def claim_channel_for_session(cls, session):
        """
        This is a non-blocking acquire.

        The session that claims a channel must also release it when it's over.
        Returns True if it was able to claim the channel.
        """
        channel = session.get_channel()
        with cls._critical_section(channel):
            if cls._channel_is_available_for_session(session):
                cls._set_running_session_info_for_channel(
                    channel,
                    RunningSessionInfo(session.session_id, session.connection_id),
                    # We aren't relying on the expiry here to free up the session: we manually release it.
                    # Still, there is no situation where we'd want to keep this longer than that.
                    session.expire_after * 60,
                )
                return True
            else:
                return False
def claim_channel_for_session ( cls , session ) : channel = session . get_channel ( ) with cls . _critical_section ( channel ) : if cls . _channel_is_available_for_session ( session ) : cls . _set_running_session_info_for_channel ( channel , RunningSessionInfo ( session . session_id , session . connection_id ) , # We aren't relying on the expiry here to free up the session: we manually release it. # Still, there is no situation where we'd want to keep this longer than that. session . expire_after * 60 , ) return True else : return False