Home | History | Annotate | Download | only in okio

Lines Matching defs:timeout

31  * This class offers two complementary controls to define a timeout policy.
44 public class Timeout {
46 * An empty timeout that neither tracks nor detects timeouts. Use this when
50 public static final Timeout NONE = new Timeout() {
51 @Override public Timeout timeout(long timeout, TimeUnit unit) {
55 @Override public Timeout deadlineNanoTime(long deadlineNanoTime) {
71 public Timeout() {
75 * Wait at most {@code timeout} time before aborting an operation. Using a
76 * per-operation timeout means that as long as forward progress is being made,
79 * <p>If {@code timeout == 0}, operations will run indefinitely. (Operating
82 public Timeout timeout(long timeout, TimeUnit unit) {
83 if (timeout < 0) throw new IllegalArgumentException("timeout < 0: " + timeout);
85 this.timeoutNanos = unit.toNanos(timeout);
89 /** Returns the timeout in nanoseconds, or {@code 0} for no timeout. */
115 public Timeout deadlineNanoTime(long deadlineNanoTime) {
122 public final Timeout deadline(long duration, TimeUnit unit) {
128 /** Clears the timeout. Operating system timeouts may still apply. */
129 public Timeout clearTimeout() {
135 public Timeout clearDeadline() {