class documentation
class ExtractorChannel(GRPCChannel): (source)
Extract service names from gRPC stub classes.
This channel records the last method that a stub calls. It gets the service name from that method and does not make a network request.
| Async Method | __aenter__ |
Enter the asynchronous context. |
| Async Method | __aexit__ |
Exit the asynchronous context. |
| Method | __init__ |
Undocumented |
| Async Method | channel |
Return immediately because this introspection channel is ready. |
| Async Method | close |
Return without an action because this channel has no connection. |
| Method | get |
Return the service name from the last recorded method. |
| Method | get |
Return READY for this introspection channel. |
| Method | stream |
Record a stream-stream method call and return a stub. |
| Method | stream |
Record a stream-unary method call and return a stub. |
| Method | unary |
Record a unary-stream method call and return a stub. |
| Method | unary |
Record a unary-unary method call and return a stub. |
| Async Method | wait |
Reject a state-change wait for this introspection channel. |
| Instance Variable | _last |
Undocumented |
Exit the asynchronous context.
| Parameters | |
| exc | Exception type. |
| exc | Exception value. |
| exc | Exception traceback. |
Return without an action because this channel has no connection.
| Parameters | |
| grace:float or None | Optional grace period. |
Return the service name from the last recorded method.
| Returns | |
| str | The service name. |
| Raises | |
NoMethodsInServiceError | If no methods have been recorded. |
Return READY for this introspection channel.
| Parameters | |
| try | Whether to attempt connection. |
| Returns | |
ChannelConnectivity | The connectivity state. |
def stream_stream(self, method:
str, request_serializer: SerializingFunction | None = None, response_deserializer: DeserializingFunction | None = None, _registered_method: bool | None = None) -> StreamStreamMultiCallable:
(source)
¶
Record a stream-stream method call and return a stub.
| Parameters | |
| method:str | The method name. |
| request | Optional request serializer. |
| response | Optional response deserializer. |
| _registered | Whether the method is registered. |
| Returns | |
| StreamStreamMultiCallable | A stub callable. |
def stream_unary(self, method:
str, request_serializer: SerializingFunction | None = None, response_deserializer: DeserializingFunction | None = None, _registered_method: bool | None = None) -> StreamUnaryMultiCallable:
(source)
¶
Record a stream-unary method call and return a stub.
| Parameters | |
| method:str | The method name. |
| request | Optional request serializer. |
| response | Optional response deserializer. |
| _registered | Whether the method is registered. |
| Returns | |
| StreamUnaryMultiCallable | A stub callable. |
def unary_stream(self, method:
str, request_serializer: SerializingFunction | None = None, response_deserializer: DeserializingFunction | None = None, _registered_method: bool | None = None) -> UnaryStreamMultiCallable[ Req, Res]:
(source)
¶
Record a unary-stream method call and return a stub.
| Parameters | |
| method:str | The method name. |
| request | Optional request serializer. |
| response | Optional response deserializer. |
| _registered | Whether the method is registered. |
| Returns | |
| UnaryStreamMultiCallable | A stub callable. |
def unary_unary(self, method:
str, request_serializer: SerializingFunction | None = None, response_deserializer: DeserializingFunction | None = None, _registered_method: bool | None = False) -> UnaryUnaryMultiCallable[ Req, Res]:
(source)
¶
Record a unary-unary method call and return a stub.
| Parameters | |
| method:str | The method name. |
| request | Optional request serializer. |
| response | Optional response deserializer. |
| _registered | Whether the method is registered. |
| Returns | |
| UnaryUnaryMultiCallable | A stub callable. |
Reject a state-change wait for this introspection channel.
| Parameters | |
lastChannelConnectivity | The last observed state. |
| Raises | |
NotImplementedError | Always raised. |