park

Native
1.3
fun park(
    timeoutMicroseconds: Long,
    process: Boolean = false
): Boolean

(source)

Park execution of the current worker until a new request arrives or timeout specified in timeoutMicroseconds elapsed. If process is true, pending queue elements are processed, including delayed requests. Note that multiple requests could be processed this way.

Parameters

timeoutMicroseconds - defines how long to park worker if no requests arrive, waits forever if -1.

process - defines if arrived request(s) shall be processed.

Exceptions

IllegalStateException - if this request is executed on non-current Worker.

IllegalArgumentException - if timeout value is incorrect.

Return if process is true: if request(s) was processed true and false otherwise. if process is false: true if request(s) has arrived and false if timeout happens.