Home | History | Annotate | Download | only in okio

Lines Matching refs:Timeout

30  * This class offers two complementary controls to define a timeout policy.
42 public class Timeout {
44 * An empty timeout that neither tracks nor detects timeouts. Use this when
48 public static final Timeout NONE = new Timeout() {
49 @Override public Timeout timeout(long timeout, TimeUnit unit) {
53 @Override public Timeout deadlineNanoTime(long deadlineNanoTime) {
69 public Timeout() {
73 * Wait at most {@code timeout} time before aborting an operation. Using a
74 * per-operation timeout means that as long as forward progress is being made,
77 * <p>If {@code timeout == 0}, operations will run indefinitely. (Operating
80 public Timeout timeout(long timeout, TimeUnit unit) {
81 if (timeout < 0) throw new IllegalArgumentException("timeout < 0: " + timeout);
83 this.timeoutNanos = unit.toNanos(timeout);
87 /** Returns the timeout in nanoseconds, or {@code 0} for no timeout. */
113 public Timeout deadlineNanoTime(long deadlineNanoTime) {
120 public final Timeout deadline(long duration, TimeUnit unit) {
126 /** Clears the timeout. Operating system timeouts may still apply. */
127 public Timeout clearTimeout() {
133 public Timeout clearDeadline() {