Skip to content

okio / okio / ForwardingTimeout


(jvm) open class ForwardingTimeout :Timeout

A Timeout which forwards calls to another. Useful for subclassing.


Name Summary
(jvm) <init> A Timeout which forwards calls to another. Useful for subclassing.ForwardingTimeout(delegate:Timeout)


Name Summary
(jvm) delegate var delegate:Timeout


Name Summary
(jvm) clearDeadline Clears the fun clearDeadline():Timeout
(jvm) clearTimeout Clears the timeout. Operating system timeouts may still fun clearTimeout():Timeout
(jvm) deadlineNanoTime Returns the nano time when the deadline will be fun deadlineNanoTime():Long
Sets the nano time when the deadline will be reached. All operations must complete before this time. Use a deadline to set a maximum bound on the time spent on a sequence of fun deadlineNanoTime(deadlineNanoTime:Long):Timeout
(jvm) hasDeadline Returns true if a deadline is fun hasDeadline():Boolean
(jvm) setDelegate fun setDelegate(delegate:Timeout):ForwardingTimeout
(jvm) throwIfReached Throws an InterruptedIOException if the deadline has been reached or if the current thread has been interrupted. This method doesn’t detect timeouts; that should be implemented to asynchronously abort an in-progress fun throwIfReached():Unit
(jvm) timeout Wait at most timeout time before aborting an operation. Using a per-operation timeout means that as long as forward progress is being made, no sequence of operations will fun timeout(timeout:Long, unit:TimeUnit):Timeout
(jvm) timeoutNanos Returns the timeout in nanoseconds, or 0 for no fun timeoutNanos():Long

Inherited Functions

Name Summary
(jvm) deadline Set a deadline of now plus duration deadline(duration:Long, unit:TimeUnit):Timeout
(jvm) intersectWith Applies the minimum intersection between this timeout and other, run block, then finally rollback this timeout’s intersectWith(other:Timeout, block: () ->Unit):Unit
(jvm) waitUntilNotified Waits on monitor until it is notified. Throws InterruptedIOException if either the thread is interrupted or if this timeout elapses before monitor is notified. The caller must be synchronized on waitUntilNotified(monitor:Any):Unit