summaryrefslogtreecommitdiffstats
path: root/http-utils/src/main/java/ai/vespa/util/http/hc4/retry/RetryConsumer.java
diff options
context:
space:
mode:
authorgjoranv <gv@verizonmedia.com>2021-10-21 16:03:52 +0200
committergjoranv <gv@verizonmedia.com>2021-10-21 16:03:52 +0200
commitce0a56bd3ffedc1b64473aa3363cf59856af96d3 (patch)
tree937341db459636129883d4b4945a6d318de3a3d8 /http-utils/src/main/java/ai/vespa/util/http/hc4/retry/RetryConsumer.java
parent85f0012937e76a96414c9fc9402b270186fcc9f4 (diff)
Revert "Remove the http-utils module (now embedded in vespajlib)"
This reverts commit 7963cb974fdc63ae529b0c0895ea4ccc339b6a53.
Diffstat (limited to 'http-utils/src/main/java/ai/vespa/util/http/hc4/retry/RetryConsumer.java')
-rw-r--r--http-utils/src/main/java/ai/vespa/util/http/hc4/retry/RetryConsumer.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/http-utils/src/main/java/ai/vespa/util/http/hc4/retry/RetryConsumer.java b/http-utils/src/main/java/ai/vespa/util/http/hc4/retry/RetryConsumer.java
new file mode 100644
index 00000000000..c168f7d50c9
--- /dev/null
+++ b/http-utils/src/main/java/ai/vespa/util/http/hc4/retry/RetryConsumer.java
@@ -0,0 +1,16 @@
+// Copyright 2020 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package ai.vespa.util.http.hc4.retry;
+
+import org.apache.http.client.protocol.HttpClientContext;
+
+import java.time.Duration;
+
+/**
+ * Invoked before performing a delay and retry.
+ *
+ * @author bjorncs
+ */
+@FunctionalInterface
+public interface RetryConsumer<T> {
+ void onRetry(T data, Duration delay, int executionCount, HttpClientContext context);
+}