aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Mehrdad Afshari <mehrdada@users.noreply.github.com>2018-06-14 16:30:31 -0700
committerGravatar GitHub <noreply@github.com>2018-06-14 16:30:31 -0700
commit0178876a981d5bf303e78ed5a944b3f366abdf19 (patch)
tree38f3eba932bba5b7e7e719ea9eba658154a4eb90 /src
parenta726484455b098658c4418c0f4e7e284f6b528e4 (diff)
parenta5530e9e36b4d5971b14ca40e9fc3f2065c89c99 (diff)
Merge pull request #15773 from nathanielmanistaatgoogle/9320
Specify thread-safety of grpc-created channels
Diffstat (limited to 'src')
-rw-r--r--src/python/grpcio/grpc/__init__.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/python/grpcio/grpc/__init__.py b/src/python/grpcio/grpc/__init__.py
index 996d075446..863696d236 100644
--- a/src/python/grpcio/grpc/__init__.py
+++ b/src/python/grpcio/grpc/__init__.py
@@ -1572,13 +1572,15 @@ def channel_ready_future(channel):
def insecure_channel(target, options=None):
"""Creates an insecure Channel to a server.
+ The returned Channel is thread-safe.
+
Args:
target: The server address
options: An optional list of key-value pairs (channel args
in gRPC Core runtime) to configure the channel.
Returns:
- A Channel object.
+ A Channel.
"""
from grpc import _channel # pylint: disable=cyclic-import
return _channel.Channel(target, () if options is None else options, None)
@@ -1587,6 +1589,8 @@ def insecure_channel(target, options=None):
def secure_channel(target, credentials, options=None):
"""Creates a secure Channel to a server.
+ The returned Channel is thread-safe.
+
Args:
target: The server address.
credentials: A ChannelCredentials instance.
@@ -1594,7 +1598,7 @@ def secure_channel(target, credentials, options=None):
in gRPC Core runtime) to configure the channel.
Returns:
- A Channel object.
+ A Channel.
"""
from grpc import _channel # pylint: disable=cyclic-import
return _channel.Channel(target, () if options is None else options,