-
Notifications
You must be signed in to change notification settings - Fork 824
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat(timeout) constructor and test changed.
- Loading branch information
Бацура Сергей Александрович
authored and
Бацура Сергей Александрович
committed
Sep 6, 2024
1 parent
20dc197
commit 7cf859b
Showing
3 changed files
with
24 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,8 @@ | |
|
||
package net.devh.boot.grpc.client.interceptor; | ||
|
||
import static java.util.Objects.requireNonNull; | ||
|
||
import java.time.Duration; | ||
import java.util.concurrent.TimeUnit; | ||
|
||
|
@@ -24,7 +26,6 @@ | |
import io.grpc.ClientCall; | ||
import io.grpc.ClientInterceptor; | ||
import io.grpc.MethodDescriptor; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
|
||
/** | ||
|
@@ -33,11 +34,14 @@ | |
* @author Sergei Batsura ([email protected]) | ||
*/ | ||
@Slf4j | ||
@RequiredArgsConstructor | ||
public class TimeoutSetupClientInterceptor implements ClientInterceptor { | ||
|
||
private final Duration timeout; | ||
|
||
public TimeoutSetupClientInterceptor(Duration timeout) { | ||
this.timeout = requireNonNull(timeout, "timeout"); | ||
} | ||
|
||
@Override | ||
public <ReqT, RespT> ClientCall<ReqT, RespT> interceptCall( | ||
final MethodDescriptor<ReqT, RespT> method, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters