prepareForWrite

open suspend fun prepareForWrite()

Hook called by writeAndWaitForResponse before acquiring writeMutex. Subclasses can override to perform any waiting that must NOT happen while the mutex is held — e.g. RobustAMQPChannel awaits its restoreCompleted deferred here, because doing so inside the mutex would deadlock against restore's own writes (which need the same mutex).