use

inline suspend fun <S : StompSession, R> S.use(block: (S) -> R): R(source)

Executes the given block on this StompSession, and disconnects from the session whether the block terminated normally or exceptionally.