1# Copyright 2019 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"""gRPC's Asynchronous Python API. 15 16gRPC Async API objects may only be used on the thread on which they were 17created. AsyncIO doesn't provide thread safety for most of its APIs. 18""" 19 20from typing import Any, Optional, Sequence, Tuple 21 22import grpc 23from grpc._cython.cygrpc import (init_grpc_aio, shutdown_grpc_aio, EOF, 24 AbortError, BaseError, InternalError, 25 UsageError) 26 27from ._base_call import (Call, RpcContext, StreamStreamCall, StreamUnaryCall, 28 UnaryStreamCall, UnaryUnaryCall) 29from ._base_channel import (Channel, StreamStreamMultiCallable, 30 StreamUnaryMultiCallable, UnaryStreamMultiCallable, 31 UnaryUnaryMultiCallable) 32from ._call import AioRpcError 33from ._interceptor import (ClientCallDetails, ClientInterceptor, 34 InterceptedUnaryUnaryCall, 35 UnaryUnaryClientInterceptor, 36 UnaryStreamClientInterceptor, 37 StreamUnaryClientInterceptor, 38 StreamStreamClientInterceptor, ServerInterceptor) 39from ._server import server 40from ._base_server import Server, ServicerContext 41from ._typing import ChannelArgumentType 42from ._channel import insecure_channel, secure_channel 43from ._metadata import Metadata 44 45################################### __all__ ################################# 46 47__all__ = ( 48 'init_grpc_aio', 49 'shutdown_grpc_aio', 50 'AioRpcError', 51 'RpcContext', 52 'Call', 53 'UnaryUnaryCall', 54 'UnaryStreamCall', 55 'StreamUnaryCall', 56 'StreamStreamCall', 57 'Channel', 58 'UnaryUnaryMultiCallable', 59 'UnaryStreamMultiCallable', 60 'StreamUnaryMultiCallable', 61 'StreamStreamMultiCallable', 62 'ClientCallDetails', 63 'ClientInterceptor', 64 'UnaryStreamClientInterceptor', 65 'UnaryUnaryClientInterceptor', 66 'StreamUnaryClientInterceptor', 67 'StreamStreamClientInterceptor', 68 'InterceptedUnaryUnaryCall', 69 'ServerInterceptor', 70 'insecure_channel', 71 'server', 72 'Server', 73 'ServicerContext', 74 'EOF', 75 'secure_channel', 76 'AbortError', 77 'BaseError', 78 'UsageError', 79 'InternalError', 80 'Metadata', 81) 82