offer

open suspend override fun offer(e: E, timeout: Long, unit: TimeUnit): Boolean

Inserts the specified element at the tail of this queue, waiting if necessary up to the specified wait time for space to become available.

Return

true if successful, or false if the specified waiting time elapses before space is available

Throws


open override fun offer(e: E): Boolean

Inserts the specified element at the tail of this queue if it is possible to do so immediately without exceeding the queue's capacity, returning true upon success and false if this queue is full. When using a capacity-restricted queue, this method is generally preferable to method add, which can fail to insert an element only by throwing an exception.

Throws

if the specified element is null