elizarov
produce { try { registerCallback { ... } awaitCancel() // see message above } finally { unregisterCallback() } }