__init__.py 3.1 KB

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