Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
21035da1
Commit
21035da1
authored
7 years ago
by
yang-g
Browse files
Options
Downloads
Patches
Plain Diff
Add api to server builder plugin to modify the builder
parent
081c4424
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/grpc++/impl/server_builder_plugin.h
+4
-0
4 additions, 0 deletions
include/grpc++/impl/server_builder_plugin.h
src/cpp/server/server_builder.cc
+4
-0
4 additions, 0 deletions
src/cpp/server/server_builder.cc
with
8 additions
and
0 deletions
include/grpc++/impl/server_builder_plugin.h
+
4
−
0
View file @
21035da1
...
@@ -40,6 +40,7 @@
...
@@ -40,6 +40,7 @@
namespace
grpc
{
namespace
grpc
{
class
ServerBuilder
;
class
ServerInitializer
;
class
ServerInitializer
;
class
ChannelArguments
;
class
ChannelArguments
;
...
@@ -48,6 +49,9 @@ class ServerBuilderPlugin {
...
@@ -48,6 +49,9 @@ class ServerBuilderPlugin {
virtual
~
ServerBuilderPlugin
()
{}
virtual
~
ServerBuilderPlugin
()
{}
virtual
grpc
::
string
name
()
=
0
;
virtual
grpc
::
string
name
()
=
0
;
/// UpdateServerBuilder will be called at the beginning of BuildAndStart.
virtual
void
UpdateServerBuilder
(
ServerBuilder
*
builder
)
{}
// InitServer will be called in ServerBuilder::BuildAndStart(), after the
// InitServer will be called in ServerBuilder::BuildAndStart(), after the
// Server instance is created.
// Server instance is created.
virtual
void
InitServer
(
ServerInitializer
*
si
)
=
0
;
virtual
void
InitServer
(
ServerInitializer
*
si
)
=
0
;
...
...
This diff is collapsed.
Click to expand it.
src/cpp/server/server_builder.cc
+
4
−
0
View file @
21035da1
...
@@ -180,6 +180,10 @@ ServerBuilder& ServerBuilder::AddListeningPort(
...
@@ -180,6 +180,10 @@ ServerBuilder& ServerBuilder::AddListeningPort(
}
}
std
::
unique_ptr
<
Server
>
ServerBuilder
::
BuildAndStart
()
{
std
::
unique_ptr
<
Server
>
ServerBuilder
::
BuildAndStart
()
{
for
(
auto
plugin
=
plugins_
.
begin
();
plugin
!=
plugins_
.
end
();
plugin
++
)
{
(
*
plugin
)
->
UpdateServerBuilder
(
this
);
}
ChannelArguments
args
;
ChannelArguments
args
;
for
(
auto
option
=
options_
.
begin
();
option
!=
options_
.
end
();
++
option
)
{
for
(
auto
option
=
options_
.
begin
();
option
!=
options_
.
end
();
++
option
)
{
(
*
option
)
->
UpdateArguments
(
&
args
);
(
*
option
)
->
UpdateArguments
(
&
args
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment