run

suspend fun <T> run(block: suspend () -> T): T?

Runs block and returns its value, or returns null without running it while the window is open.

The window starts when a permitted block begins; a failed or cancelled block still consumes it. The block runs outside the internal lock, so concurrent callers are rejected instead of queued.

Cancellation: waiting for the internal lock is cancellable and rethrows; cancellation inside block rethrows after the window has started.