Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
z
Classes
Class List
Class Hierarchy
Class Members
All
:
[
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
[
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
Enumerations
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Properties
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Related Functions
:
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
grpc
src
core
ext
transport
binder
client
endpoint_binder_pool.h
Go to the documentation of this file.
1
// Copyright 2021 gRPC authors.
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
15
#ifndef GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_ENDPOINT_BINDER_POOL_H
16
#define GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_ENDPOINT_BINDER_POOL_H
17
18
#include <
grpc/support/port_platform.h
>
19
20
#include <functional>
21
#include <string>
22
23
#include "absl/container/flat_hash_map.h"
24
25
#include "
src/core/ext/transport/binder/wire_format/binder.h
"
26
#include "
src/core/lib/gprpp/sync.h
"
27
28
namespace
grpc_binder
{
29
30
// This class serves as a buffer of endpoint binders between C++ and
31
// Java. `AddEndpointBinder` will be indirectly invoked by Java code, and
32
// `GetEndpointBinder` is for C++ code to register callback to get endpoint
33
// binder when become available. This simplifies JNI related threading issues
34
// since both side only need to interact with this buffer in non-blocking
35
// manner and avoids cross-language callbacks.
36
class
EndpointBinderPool
{
37
public
:
38
// Invokes the callback when the binder corresponding to the conn_id become
39
// available. If the binder is already available, invokes the callback
40
// immediately.
41
// Ownership of the endpoint binder will be transferred to the callback
42
// function and it will be removed from the pool
43
void
GetEndpointBinder
(
44
std::string
conn_id,
45
std::function
<
void
(std::unique_ptr<grpc_binder::Binder>)>
cb
);
46
47
// Add an endpoint binder to the pool
48
void
AddEndpointBinder
(
std::string
conn_id,
49
std::unique_ptr<grpc_binder::Binder>
b
);
50
51
private
:
52
grpc_core::Mutex
m_
;
53
absl::flat_hash_map<std::string, std::unique_ptr<grpc_binder::Binder>
>
54
binder_map_
ABSL_GUARDED_BY
(
m_
);
55
absl::flat_hash_map
<
std::string
,
56
std::function
<void(std::unique_ptr<grpc_binder::Binder>)>>
57
pending_requests_
ABSL_GUARDED_BY
(
m_
);
58
};
59
60
// Returns the singleton
61
EndpointBinderPool
*
GetEndpointBinderPool
();
62
63
}
// namespace grpc_binder
64
65
#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_ENDPOINT_BINDER_POOL_H
grpc_binder::EndpointBinderPool::m_
grpc_core::Mutex m_
Definition:
endpoint_binder_pool.h:52
binder.h
grpc_binder::EndpointBinderPool::GetEndpointBinder
void GetEndpointBinder(std::string conn_id, std::function< void(std::unique_ptr< grpc_binder::Binder >)> cb)
Definition:
endpoint_binder_pool.cc:56
grpc_binder
Definition:
connection_id_generator.cc:45
testing::internal::string
::std::string string
Definition:
bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
grpc_binder::GetEndpointBinderPool
EndpointBinderPool * GetEndpointBinderPool()
Definition:
endpoint_binder_pool.cc:108
grpc_binder::EndpointBinderPool::ABSL_GUARDED_BY
absl::flat_hash_map< std::string, std::unique_ptr< grpc_binder::Binder > > binder_map_ ABSL_GUARDED_BY(m_)
grpc_binder::EndpointBinderPool::AddEndpointBinder
void AddEndpointBinder(std::string conn_id, std::unique_ptr< grpc_binder::Binder > b)
Definition:
endpoint_binder_pool.cc:82
b
uint64_t b
Definition:
abseil-cpp/absl/container/internal/layout_test.cc:53
grpc_core::Mutex
Definition:
src/core/lib/gprpp/sync.h:61
absl::flat_hash_map
Definition:
abseil-cpp/absl/container/flat_hash_map.h:113
grpc_binder::EndpointBinderPool
Definition:
endpoint_binder_pool.h:36
function
std::function< bool(GrpcTool *, int, const char **, const CliCredentials &, GrpcToolOutputCallback)> function
Definition:
grpc_tool.cc:250
sync.h
cb
OPENSSL_EXPORT pem_password_cb * cb
Definition:
pem.h:351
port_platform.h
grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:59:15