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.SetMaxMessageSize(std::numeric_limits<int32>::max());
|
||||||
builder.SetOption(
|
builder.SetOption(
|
||||||
std::unique_ptr<::grpc::ServerBuilderOption>(new NoReusePortOption));
|
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_impl_ = CreateMaster(&master_env_);
|
||||||
master_service_ = NewGrpcMasterService(master_impl_.get(), config, &builder);
|
master_service_ = NewGrpcMasterService(master_impl_.get(), config, &builder);
|
||||||
worker_impl_ =
|
worker_impl_ =
|
||||||
|
@ -59,6 +59,9 @@ typedef std::function<std::unique_ptr<GrpcWorker>(WorkerEnv*)>
|
|||||||
class GrpcServer : public ServerInterface {
|
class GrpcServer : public ServerInterface {
|
||||||
protected:
|
protected:
|
||||||
GrpcServer(const ServerDef& server_def, Env* env);
|
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:
|
public:
|
||||||
static Status Create(const ServerDef& server_def, Env* env,
|
static Status Create(const ServerDef& server_def, Env* env,
|
||||||
|
Loading…
Reference in New Issue
Block a user