withLock

fun <T> withLock(session: OctaviusSessionOperations, block: () -> T): T

Takes the lock, runs block, and gives the lock back however that went.

Throws

LOCK_NOT_ACQUIRED if the wait ran out - which means another migrator is still going, or a session somewhere is holding the lock and not moving.