-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make grpc server shutdown timeout configurable (#117)
* Make grpc server shutdown timeout configurable * Fix * Polish
- Loading branch information
1 parent
ba8964c
commit 9effe50
Showing
3 changed files
with
34 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version = 1.7.1 | ||
sbt.version = 1.9.3 |
7 changes: 5 additions & 2 deletions
7
protocol-grpc/src/main/scala/com/devsisters/shardcake/GrpcConfig.scala
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 |
---|---|---|
@@ -1,16 +1,19 @@ | ||
package com.devsisters.shardcake | ||
|
||
import zio._ | ||
|
||
import java.util.concurrent.Executor | ||
|
||
/** | ||
* The configuration for the gRPC client. | ||
* | ||
* @param maxInboundMessageSize the maximum message size allowed to be received by the grpc client | ||
* @param executor a custom executor to pass to grpc-java when creating gRPC clients and servers | ||
* @param shutdownTimeout the timeout to wait for the gRPC server to shutdown before forcefully shutting it down | ||
*/ | ||
case class GrpcConfig(maxInboundMessageSize: Int, executor: Option[Executor]) | ||
case class GrpcConfig(maxInboundMessageSize: Int, executor: Option[Executor], shutdownTimeout: Duration) | ||
|
||
object GrpcConfig { | ||
val default: GrpcConfig = | ||
GrpcConfig(maxInboundMessageSize = 32 * 1024 * 1024, None) | ||
GrpcConfig(maxInboundMessageSize = 32 * 1024 * 1024, None, 3.seconds) | ||
} |
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