timeout

@CheckReturnValue
fun timeout(timeout: Long, unit: TimeUnit, onTimeout: Runnable? = null): ModalBuilder(source)

Sets the timeout for this modal, invalidating the modal after expiration, and running the given timeout handler.

If unset, the timeout is set to Modals.defaultTimeout.

Return

This builder for chaining convenience

Parameters

timeout

The amount of time in the supplied time unit before the modal is removed

unit

The time unit of the timeout

onTimeout

The function to run when the timeout has been reached


@CheckReturnValue
fun timeout(timeout: Duration, onTimeout: Runnable? = null): ModalBuilder(source)
abstract fun timeout(timeout: Duration, onTimeout: suspend () -> Unit? = null): ModalBuilder(source)

Sets the timeout for this modal, invalidating the modal after expiration, and running the given timeout handler.

If unset, the timeout is set to Modals.defaultTimeout.

Return

This builder for chaining convenience

Parameters

timeout

The amount of time before the modal is removed

onTimeout

The function to run when the timeout has been reached