park
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.
Since Kotlin
1.3Return
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.
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.
Throws
if this request is executed on non-current Worker.
if timeout value is incorrect.