From c2bddaa06250f3f74f097dcdc1d7ab7e4c75f981 Mon Sep 17 00:00:00 2001 From: hexiaofeng Date: Wed, 8 May 2024 08:08:01 +0800 Subject: [PATCH] Review retry --- .../governance/request/ServiceRequest.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/joylive-core/joylive-governance-api/src/main/java/com/jd/live/agent/governance/request/ServiceRequest.java b/joylive-core/joylive-governance-api/src/main/java/com/jd/live/agent/governance/request/ServiceRequest.java index 3587758e..944b56a1 100644 --- a/joylive-core/joylive-governance-api/src/main/java/com/jd/live/agent/governance/request/ServiceRequest.java +++ b/joylive-core/joylive-governance-api/src/main/java/com/jd/live/agent/governance/request/ServiceRequest.java @@ -120,6 +120,36 @@ interface InboundRequest extends ServiceRequest { */ interface OutboundRequest extends ServiceRequest { + /** + * Retrieves the configured timeout value. + *

+ * This method returns the timeout setting for the current request. The timeout + * is expressed in milliseconds and represents the maximum time allowed for a certain + * operation to complete. A return value of 0 may indicate that no timeout is set, + * implying an operation could potentially wait indefinitely. + *

+ * + * @return The timeout value in milliseconds. A value of 0 may indicate no timeout. + */ + default long getTimeout() { + return 0; + } + + /** + * Sets the timeout value for the current request. + *

+ * This method allows specifying a timeout in milliseconds, which determines the maximum + * duration allowed for a certain operation to complete. Setting this value influences + * how long a process will wait before timing out. A value of 0 can be used to indicate + * that there should be no timeout, allowing the operation to continue indefinitely until + * completion. + *

+ * + * @param timeout The desired timeout in milliseconds. A value of 0 indicates no timeout. + */ + default void setTimeout(long timeout) { + } + } }