Allow child class of Server to supply custom ChannelArguments
PiperOrigin-RevId: 209685137
This commit is contained in:
parent
3cb13feff0
commit
95d718a8a4
@ -190,6 +190,8 @@ Status GrpcServer::Init(
|
||||
builder.SetMaxMessageSize(std::numeric_limits<int32>::max());
|
||||
builder.SetOption(
|
||||
std::unique_ptr<::grpc::ServerBuilderOption>(new NoReusePortOption));
|
||||
// Allow subclasses to specify more args to pass to the gRPC server.
|
||||
MaybeMutateBuilder(&builder);
|
||||
master_impl_ = CreateMaster(&master_env_);
|
||||
master_service_ = NewGrpcMasterService(master_impl_.get(), config, &builder);
|
||||
worker_impl_ =
|
||||
|
@ -59,6 +59,9 @@ typedef std::function<std::unique_ptr<GrpcWorker>(WorkerEnv*)>
|
||||
class GrpcServer : public ServerInterface {
|
||||
protected:
|
||||
GrpcServer(const ServerDef& server_def, Env* env);
|
||||
// Allow children classes to override this and provide custom args to the
|
||||
// server before it is constructed. Default behavior is to do nothing.
|
||||
virtual void MaybeMutateBuilder(::grpc::ServerBuilder* builder) {}
|
||||
|
||||
public:
|
||||
static Status Create(const ServerDef& server_def, Env* env,
|
||||
|
Loading…
Reference in New Issue
Block a user