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
da069a50
Commit
da069a50
authored
8 years ago
by
Sree Kuchibhotla
Browse files
Options
Downloads
Patches
Plain Diff
Rename sync_methods_ to sync_requests_
parent
385c9b2f
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++/server.h
+1
-1
1 addition, 1 deletion
include/grpc++/server.h
src/cpp/server/server_cc.cc
+10
-10
10 additions, 10 deletions
src/cpp/server/server_cc.cc
with
11 additions
and
11 deletions
include/grpc++/server.h
+
1
−
1
View file @
da069a50
...
...
@@ -203,7 +203,7 @@ class Server GRPC_FINAL : public ServerInterface, private GrpcLibraryCodegen {
grpc
::
mutex
mu_
;
bool
started_
;
bool
shutdown_
;
bool
shutdown_notified_
;
bool
shutdown_notified_
;
// Was notify called on the shutdown_cv_
grpc
::
condition_variable
shutdown_cv_
;
...
...
This diff is collapsed.
Click to expand it.
src/cpp/server/server_cc.cc
+
10
−
10
View file @
da069a50
/*
*
* Copyright 2015, Google Inc.
* All rights reserved.
*
...
...
@@ -304,15 +303,14 @@ class Server::SyncRequestThreadManager : public ThreadManager {
}
void
AddSyncMethod
(
RpcServiceMethod
*
method
,
void
*
tag
)
{
sync_
method
s_
.
emplace_back
(
method
,
tag
);
sync_
request
s_
.
emplace_back
(
method
,
tag
);
}
void
AddUnknownSyncMethod
()
{
// TODO (sreek) - Check if !sync_methods_.empty() is really needed here
if
(
!
sync_methods_
.
empty
())
{
if
(
!
sync_requests_
.
empty
())
{
unknown_method_
.
reset
(
new
RpcServiceMethod
(
"unknown"
,
RpcMethod
::
BIDI_STREAMING
,
new
UnknownMethodHandler
));
sync_
method
s_
.
emplace_back
(
unknown_method_
.
get
(),
nullptr
);
sync_
request
s_
.
emplace_back
(
unknown_method_
.
get
(),
nullptr
);
}
}
...
...
@@ -328,8 +326,8 @@ class Server::SyncRequestThreadManager : public ThreadManager {
}
void
Start
()
{
if
(
!
sync_
method
s_
.
empty
())
{
for
(
auto
m
=
sync_
method
s_
.
begin
();
m
!=
sync_
method
s_
.
end
();
m
++
)
{
if
(
!
sync_
request
s_
.
empty
())
{
for
(
auto
m
=
sync_
request
s_
.
begin
();
m
!=
sync_
request
s_
.
end
();
m
++
)
{
m
->
SetupRequest
();
m
->
Request
(
server_
->
c_server
(),
server_cq_
->
cq
());
}
...
...
@@ -342,7 +340,7 @@ class Server::SyncRequestThreadManager : public ThreadManager {
Server
*
server_
;
CompletionQueue
*
server_cq_
;
int
cq_timeout_msec_
;
std
::
vector
<
SyncRequest
>
sync_
method
s_
;
std
::
vector
<
SyncRequest
>
sync_
request
s_
;
std
::
unique_ptr
<
RpcServiceMethod
>
unknown_method_
;
std
::
shared_ptr
<
Server
::
GlobalCallbacks
>
global_callbacks_
;
};
...
...
@@ -431,6 +429,7 @@ bool Server::RegisterService(const grpc::string* host, Service* service) {
if
(
it
->
get
()
==
nullptr
)
{
// Handled by generic service if any.
continue
;
}
RpcServiceMethod
*
method
=
it
->
get
();
void
*
tag
=
grpc_server_register_method
(
server_
,
method
->
name
(),
host
?
host
->
c_str
()
:
nullptr
,
...
...
@@ -440,13 +439,15 @@ bool Server::RegisterService(const grpc::string* host, Service* service) {
method
->
name
());
return
false
;
}
if
(
method
->
handler
()
==
nullptr
)
{
if
(
method
->
handler
()
==
nullptr
)
{
// Async method
method
->
set_server_tag
(
tag
);
}
else
{
for
(
auto
it
=
sync_req_mgrs_
.
begin
();
it
!=
sync_req_mgrs_
.
end
();
it
++
)
{
(
*
it
)
->
AddSyncMethod
(
method
,
tag
);
}
}
method_name
=
method
->
name
();
}
...
...
@@ -499,7 +500,6 @@ bool Server::Start(ServerCompletionQueue** cqs, size_t num_cqs) {
return
true
;
}
/* TODO (sreek) check if started_ and shutdown_ are needed anymore */
void
Server
::
ShutdownInternal
(
gpr_timespec
deadline
)
{
grpc
::
unique_lock
<
grpc
::
mutex
>
lock
(
mu_
);
if
(
started_
&&
!
shutdown_
)
{
...
...
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