| [ Web Proxy ] |
| Viewing: https://grpc.github.io/grpc/python/_modules/../grpc.html#grpc.StreamStreamClientInterceptor | [Back] [Original] |
For documentation, examples, and more, see the Python gRPC page on grpc.io.
The version string is available as grpc.__version__.
Creates an insecure Channel to a server.
The returned Channel is thread-safe.
target The server address
options An optional list of key-value pairs (channel_arguments in gRPC Core runtime) to configure the channel.
compression An optional value indicating the compression method to be used over the lifetime of the channel.
A Channel.
Creates a secure Channel to a server.
The returned Channel is thread-safe.
target The server address.
credentials A ChannelCredentials instance.
options An optional list of key-value pairs (channel_arguments in gRPC Core runtime) to configure the channel.
compression An optional value indicating the compression method to be used over the lifetime of the channel.
A Channel.
Intercepts a channel through a set of interceptors.
channel A Channel.
interceptors Zero or more objects of type UnaryUnaryClientInterceptor, UnaryStreamClientInterceptor, StreamUnaryClientInterceptor, or StreamStreamClientInterceptor. Interceptors are given control in the order they are listed.
A Channel that intercepts each invocation via the provided interceptors.
TypeError If interceptor does not derive from any of UnaryUnaryClientInterceptor, UnaryStreamClientInterceptor, StreamUnaryClientInterceptor, or StreamStreamClientInterceptor.
Creates a ChannelCredentials for use with an SSL-enabled Channel.
root_certificates The PEM-encoded root certificates as a byte string, or None to retrieve them from a default location chosen by gRPC runtime.
private_key The PEM-encoded private key as a byte string, or None if no private key should be used.
certificate_chain The PEM-encoded certificate chain as a byte string to use or None if no certificate chain should be used.
A ChannelCredentials for use with an SSL-enabled Channel.
Construct CallCredentials from an AuthMetadataPlugin.
metadata_plugin An AuthMetadataPlugin to use for authentication.
name An optional name for the plugin.
A CallCredentials.
Construct CallCredentials from an access token.
access_token A string to place directly in the http request authorization header, for example authorization: Bearer <access_token>.
A CallCredentials.
Compose multiple CallCredentials to make a new CallCredentials.
*call_credentials At least two CallCredentials objects.
A CallCredentials object composed of the given CallCredentials objects.
Compose a ChannelCredentials and one or more CallCredentials objects.
channel_credentials A ChannelCredentials object.
*call_credentials One or more CallCredentials objects.
CallCredentials objects.
Creates a local ChannelCredentials used for local connections.
This is an EXPERIMENTAL API.
Local credentials are used by local TCP endpoints (e.g. localhost:10000) also UDS connections.
The connections created by local channel credentials are not encrypted, but will be checked if they are local or not. The UDS connections are considered secure by providing peer authentication and data confidentiality while TCP connections are considered insecure.
It is allowed to transmit call credentials over connections created by local channel credentials.
Local channel credentials are useful for 1) eliminating insecure_channel usage; 2) enable unit testing for call credentials without setting up secrets.
local_connect_type Local connection type (either grpc.LocalConnectionType.UDS or grpc.LocalConnectionType.LOCAL_TCP)
A ChannelCredentials for use with a local Channel
Creates a compute engine channel credential.
This credential can only be used in a GCP environment as it relies on a handshaker service. For more info about ALTS, see https://cloud.google.com/security/encryption-in-transit/application-layer-transport-security
This channel credential is expected to be used as part of a composite credential in conjunction with a call credentials that authenticates the VMs default service account. If used with any other sort of call credential, the connection may suddenly and unexpectedly begin failing RPCs.
Creates a Server with which RPCs can be serviced.
thread_pool A futures.ThreadPoolExecutor to be used by the Server to execute RPC handlers.
handlers An optional list of GenericRpcHandlers used for executing RPCs. More handlers may be added by calling add_generic_rpc_handlers any time before the server is started.
interceptors An optional list of ServerInterceptor objects that observe and optionally manipulate the incoming RPCs before handing them over to handlers. The interceptors are given control in the order they are specified. This is an EXPERIMENTAL API.
options An optional list of key-value pairs (channel_arguments in gRPC runtime) to configure the channel.
maximum_concurrent_rpcs The maximum number of concurrent RPCs this server will service before returning RESOURCE_EXHAUSTED status, or None to indicate no limit.
compression An element of grpc.Compression, e.g. grpc.Compression.Gzip. This compression algorithm will be used for the lifetime of the server unless overridden.
xds If set to true, retrieves server configuration via xDS. This is an EXPERIMENTAL option.
A Server object.
Creates a ServerCredentials for use with an SSL-enabled Server.
private_key_certificate_chain_pairs A list of pairs of the form [PEM-encoded private key, PEM-encoded certificate chain].
root_certificates An optional byte string of PEM-encoded client root certificates that the server will use to verify client authentication. If omitted, require_client_auth must also be False.
require_client_auth A boolean indicating whether or not to require clients to be authenticated. May only be True if root_certificates is not None.
A ServerCredentials for use with an SSL-enabled Server. Typically, this object is an argument to add_secure_port() method during server setup.
Creates a ServerCertificateConfiguration for use with a Server.
private_key_certificate_chain_pairs A collection of pairs of the form [PEM-encoded private key, PEM-encoded certificate chain].
root_certificates An optional byte string of PEM-encoded client root certificates that the server will use to verify client authentication.
configuration fetching callback.
Creates a ServerCredentials for use with an SSL-enabled Server.
initial_certificate_configuration (ServerCertificateConfiguration) The certificate configuration with which the server will be initialized.
certificate_configuration_fetcher (callable) A callable that takes no arguments and should return a ServerCertificateConfiguration to replace the servers current certificate, or None for no change (i.e., the server will continue its current certificate config). The library will call this callback on every new client connection before starting the TLS handshake with the client, thus allowing the user application to optionally return a new ServerCertificateConfiguration that the server will then use for the handshake.
require_client_authentication A boolean indicating whether or not to require clients to be authenticated.
A ServerCredentials.
Creates a local ServerCredentials used for local connections.
This is an EXPERIMENTAL API.
Local credentials are used by local TCP endpoints (e.g. localhost:10000) also UDS connections.
The connections created by local server credentials are not encrypted, but will be checked if they are local or not. The UDS connections are considered secure by providing peer authentication and data confidentiality while TCP connections are considered insecure.
It is allowed to transmit call credentials over connections created by local server credentials.
Local server credentials are useful for 1) eliminating insecure_channel usage; 2) enable unit testing for call credentials without setting up secrets.
local_connect_type Local connection type (either grpc.LocalConnectionType.UDS or grpc.LocalConnectionType.LOCAL_TCP)
A ServerCredentials for use with a local Server
Types of local connection for local credential creation.
Unix domain socket connections
Local TCP connections.
Creates an RpcMethodHandler for a unary-unary RPC method.
behavior The implementation of an RPC that accepts one request and returns one response.
request_deserializer An optional deserializer for request deserialization.
response_serializer An optional serializer for response serialization.
An RpcMethodHandler object that is typically used by grpc.Server.
Creates an RpcMethodHandler for a unary-stream RPC method.
behavior The implementation of an RPC that accepts one request and returns an iterator of response values.
request_deserializer An optional deserializer for request deserialization.
response_serializer An optional serializer for response serialization.
An RpcMethodHandler object that is typically used by grpc.Server.
Creates an RpcMethodHandler for a stream-unary RPC method.
behavior The implementation of an RPC that accepts an iterator of request values and returns a single response value.
request_deserializer An optional deserializer for request deserialization.
response_serializer An optional serializer for response serialization.
An RpcMethodHandler object that is typically used by grpc.Server.
Creates an RpcMethodHandler for a stream-stream RPC method.
behavior The implementation of an RPC that accepts an iterator of request values and returns an iterator of response values.
request_deserializer An optional deserializer for request deserialization.
response_serializer An optional serializer for response serialization.
An RpcMethodHandler object that is typically used by grpc.Server.
Creates a GenericRpcHandler from RpcMethodHandlers.
service The name of the service that is implemented by the method_handlers.
method_handlers A dictionary that maps method names to corresponding RpcMethodHandler.
A GenericRpcHandler. This is typically added to the grpc.Server object with add_generic_rpc_handlers() before starting the server.
Creates a Future that tracks when a Channel is ready.
Cancelling the Future does not affect the channels state machine. It merely decouples the Future from channel state machine.
channel A Channel object.
A Future object that matures when the channel connectivity is ChannelConnectivity.READY.
Mirrors grpc_connectivity_state in the gRPC Core.
The channel is idle.
The channel is connecting.
The channel is ready to conduct RPCs.
The channel has seen a failure from which it expects to recover.
The channel has seen a failure from which it cannot recover.
Mirrors grpc_status_code in the gRPC Core.
Not an error; returned on success
The operation was cancelled (typically by the caller).
Unknown error.
Client specified an invalid argument.
Deadline expired before operation could complete.
Some requested entity (e.g., file or directory) was not found.
Some entity that we attempted to create (e.g., file or directory) already exists.
The caller does not have permission to execute the specified operation.
The request does not have valid authentication credentials for the operation.
Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space.
Operation was rejected because the system is not in a state required for the operations execution.
The operation was aborted, typically due to a concurrency issue like sequencer check failures, transaction aborts, etc.
Operation is not implemented or not supported/enabled in this service.
Internal errors. Means some invariants expected by underlying system has been broken.
The service is currently unavailable.
Unrecoverable data loss or corruption.
Affords RPC invocation via generic methods on client-side.
Channel objects implement the Context Manager type, although they need not support being entered and exited multiple times.
Exits the runtime context related to the channel object.
Closes this Channel and releases all resources held by it.
Closing the Channel will immediately terminate all RPCs active with the Channel and it is not valid to invoke new RPCs with the Channel.
This method is idempotent.
Creates a StreamStreamMultiCallable for a stream-stream method.
method The name of the RPC method.
request_serializer Optional serializer for serializing the request message. Request goes unserialized in case None is passed.
response_deserializer Optional deserializer for deserializing the response message. Response goes undeserialized in case None is passed.
_registered_method Implementation Private. A bool representing whether the method is registered.
A StreamStreamMultiCallable value for the named stream-stream method.
Creates a StreamUnaryMultiCallable for a stream-unary method.
method The name of the RPC method.
request_serializer Optional serializer for serializing the request message. Request goes unserialized in case None is passed.
response_deserializer Optional deserializer for deserializing the response message. Response goes undeserialized in case None is passed.
_registered_method Implementation Private. A bool representing whether the method is registered.
A StreamUnaryMultiCallable value for the named stream-unary method.
Subscribe to this Channels connectivity state machine.
A Channel may be in any of the states described by ChannelConnectivity. This method allows application to monitor the state transitions. The typical use case is to debug or gain better visibility into gRPC runtimes state.
callback A callable to be invoked with ChannelConnectivity argument. ChannelConnectivity describes current state of the channel. The callable will be invoked immediately upon subscription and again for every change to ChannelConnectivity until it is unsubscribed or this Channel object goes out of scope.
try_to_connect A boolean indicating whether or not this Channel should attempt to connect immediately. If set to False, gRPC runtime decides when to connect.
Creates a UnaryStreamMultiCallable for a unary-stream method.
method The name of the RPC method.
request_serializer Optional serializer for serializing the request message. Request goes unserialized in case None is passed.
response_deserializer Optional deserializer for deserializing the response message. Response goes undeserialized in case None is passed.
_registered_method Implementation Private. A bool representing whether the method is registered.
A UnaryStreamMultiCallable value for the name unary-stream method.
Creates a UnaryUnaryMultiCallable for a unary-unary method.
method The name of the RPC method.
request_serializer Optional serializer for serializing the request message. Request goes unserialized in case None is passed.
response_deserializer Optional deserializer for deserializing the response message. Response goes undeserialized in case None is passed.
_registered_method Implementation Private. A bool representing whether the method is registered.
A UnaryUnaryMultiCallable value for the named unary-unary method.
Services RPCs.
Registers GenericRpcHandlers with this Server.
This method is only safe to call before the server is started.
generic_rpc_handlers An iterable of GenericRpcHandlers that will be
RPCs. (used to service)
Opens an insecure port for accepting RPCs.
This method may only be called before starting the server.
address The address for which to open a port. If the port is 0, or not specified in the address, then gRPC runtime will choose a port.
An integer port on which server will accept RPC requests.
Registers GenericRpcHandlers with this Server.
This method is only safe to call before the server is started.
If the same method have both generic and registered handler, registered handler will take precedence.
service_name The service name.
method_handlers A dictionary that maps method names to corresponding RpcMethodHandler.
Opens a secure port for accepting RPCs.
This method may only be called before starting the server.
address The address for which to open a port. if the port is 0, or not specified in the address, then gRPC runtime will choose a port.
server_credentials A ServerCredentials object.
An integer port on which server will accept RPC requests.
Starts this Server.
This method may only be called once. (i.e. it is not idempotent).
Stops this Server.
This method immediately stop service of new RPCs in all cases.
If a grace period is specified, this method waits until all active RPCs are finished or until the grace period is reached. RPCs that havent been terminated within the grace period are aborted. If a grace period is not specified (by passing None for grace), all existing RPCs are aborted immediately and this method blocks until the last RPC handler terminates.
This method is idempotent and may be called at any time. Passing a smaller grace value in a subsequent call will have the effect of stopping the Server sooner (passing None will have the effect of stopping the server immediately). Passing a larger grace value in a subsequent call will not have the effect of stopping the server later (i.e. the most restrictive grace value is used).
grace A duration of time in seconds or None.
A threading.Event that will be set when this Server has completely stopped, i.e. when running RPCs either complete or are aborted and all handlers have terminated.
Block current thread until the server stops.
This is an EXPERIMENTAL API.
The wait will not consume computational resources during blocking, and it will block until one of the two following conditions are met:
The server is stopped or terminated;
A timeout occurs if timeout is not None.
The timeout argument works in the same way as threading.Event.wait(). https://docs.python.org/3/library/threading.html#threading.Event.wait
timeout A floating point number specifying a timeout for the operation in seconds.
A bool indicates if the operation times out.
An encapsulation of the data required to create a secure Channel.
This class has no supported interface - it exists to define the type of its instances and its instances exist to be passed to other functions. For example, ssl_channel_credentials returns an instance of this class and secure_channel requires an instance of this class.
An encapsulation of the data required to assert an identity over a call.
A CallCredentials has to be used with secure Channel, otherwise the metadata will not be transmitted to the server.
A CallCredentials may be composed with ChannelCredentials to always assert identity for every call over that Channel.
This class has no supported interface - it exists to define the type of its instances and its instances exist to be passed to other functions.
Provides information to call credentials metadata plugins.
A string URL of the service being called into.
A string of the fully qualified method name being called.
A specification for custom authentication.
Implements authentication by passing metadata to a callback.
This method will be invoked asynchronously in a separate thread.
context An AuthMetadataContext providing information on the RPC that the plugin is being called to authenticate.
callback An AuthMetadataPluginCallback to be invoked either synchronously or asynchronously.
An encapsulation of the data required to open a secure port on a Server.
This class has no supported interface - it exists to define the type of its instances and its instances exist to be passed to other functions.
A certificate configuration for use with an SSL-enabled Server.
Instances of this class can be returned in the certificate configuration fetching callback.
This class has no supported interface it exists to define the type of its instances and its instances exist to be passed to other functions.
Raised by the gRPC library to indicate non-OK-status RPC termination.
Provides RPC-related information and action.
Registers a callback to be called on RPC termination.
callback A no-parameter callable to be called on RPC termination.
the callback was not added and will not be called (because the RPC already terminated or some other reason).
Cancels the RPC.
Idempotent and has no effect if the RPC has already terminated.
Invocation-side utility object for an RPC.
Accesses the status code sent by the server.
This method blocks until the value is available.
The StatusCode value for the RPC.
Accesses the details sent by the server.
This method blocks until the value is available.
The details string of the RPC.
Describes an RPC to be invoked.
The method name of the RPC.
An optional duration of time in seconds to allow for the RPC.
An optional CallCredentials for the RPC.
An optional flag to enable wait_for_ready mechanism.
An element of grpc.Compression, e.g. grpc.Compression.Gzip.
Affords intercepting unary-unary invocations.
Intercepts a unary-unary invocation asynchronously.
continuation A function that proceeds with the invocation by executing the next interceptor in chain or invoking the actual RPC on the underlying Channel. It is the interceptors responsibility to call it if it decides to move the RPC forward. The interceptor can use response_future = continuation(client_call_details, request) to continue with the RPC. continuation returns an object that is both a Call for the RPC and a Future. In the event of RPC completion, the return Call-Futures result value will be the response message of the RPC. Should the event terminate with non-OK status, the returned Call-Futures exception value will be an RpcError.
client_call_details A ClientCallDetails object describing the outgoing RPC.
request The request value for the RPC.
An object that is both a Call for the RPC and a Future. In the event of RPC completion, the return Call-Futures result value will be the response message of the RPC. Should the event terminate with non-OK status, the returned Call-Futures exception value will be an RpcError.
Affords intercepting unary-stream invocations.
Intercepts a unary-stream invocation.
continuation A function that proceeds with the invocation by executing the next interceptor in chain or invoking the actual RPC on the underlying Channel. It is the interceptors responsibility to call it if it decides to move the RPC forward. The interceptor can use response_iterator = continuation(client_call_details, request) to continue with the RPC. continuation returns an object that is both a Call for the RPC and an iterator for response values. Drawing response values from the returned Call-iterator may raise RpcError indicating termination of the RPC with non-OK status.
client_call_details A ClientCallDetails object describing the outgoing RPC.
request The request value for the RPC.
An object that is both a Call for the RPC and an iterator of response values. Drawing response values from the returned Call-iterator may raise RpcError indicating termination of the RPC with non-OK status. This object should also fulfill the Future interface, though it may not.
Affords intercepting stream-unary invocations.
Intercepts a stream-unary invocation asynchronously.
continuation A function that proceeds with the invocation by executing the next interceptor in chain or invoking the actual RPC on the underlying Channel. It is the interceptors responsibility to call it if it decides to move the RPC forward. The interceptor can use response_future = continuation(client_call_details, request_iterator) to continue with the RPC. continuation returns an object that is both a Call for the RPC and a Future. In the event of RPC completion, the return Call-Futures result value will be the response message of the RPC. Should the event terminate with non-OK status, the returned Call-Futures exception value will be an RpcError.
client_call_details A ClientCallDetails object describing the outgoing RPC.
request_iterator An iterator that yields request values for the RPC.
An object that is both a Call for the RPC and a Future. In the event of RPC completion, the return Call-Futures result value will be the response message of the RPC. Should the event terminate with non-OK status, the returned Call-Futures exception value will be an RpcError.
Affords intercepting stream-stream invocations.
Intercepts a stream-stream invocation.
continuation A function that proceeds with the invocation by executing the next interceptor in chain or invoking the actual RPC on the underlying Channel. It is the interceptors responsibility to call it if it decides to move the RPC forward. The interceptor can use response_iterator = continuation(client_call_details, request_iterator) to continue with the RPC. continuation returns an object that is both a Call for the RPC and an iterator for response values. Drawing response values from the returned Call-iterator may raise RpcError indicating termination of the RPC with non-OK status.
client_call_details A ClientCallDetails object describing the outgoing RPC.
request_iterator An iterator that yields request values for the RPC.
An object that is both a Call for the RPC and an iterator of response values. Drawing response values from the returned Call-iterator may raise RpcError indicating termination of the RPC with non-OK status. This object should also fulfill the Future interface, though it may not.
A context object passed to method implementations.
Raises an exception to terminate the RPC with a non-OK status.
The code and details passed as arguments will supersede any existing ones.
code A StatusCode object to be sent to the client. It must not be StatusCode.OK.
details A UTF-8-encodable string to be sent to the client upon termination of the RPC.
Exception An exception is always raised to signal the abortion the RPC to the gRPC runtime.
Raises an exception to terminate the RPC with a non-OK status.
The status passed as argument will supersede any existing status code, status message and trailing metadata.
This is an EXPERIMENTAL API.
status A grpc.Status object. The status code in it must not be StatusCode.OK.
Exception An exception is always raised to signal the abortion the RPC to the gRPC runtime.
Gets the auth context for the call.
A map of strings to an iterable of bytes for each auth property.
Accesses the value to be used as status code upon RPC completion.
This is an EXPERIMENTAL API.
The StatusCode value for the RPC.
Accesses the value to be used as detail string upon RPC completion.
This is an EXPERIMENTAL API.
The details string of the RPC.
Disables compression for the next response message.
This method will override any compression configuration set during server creation or set on the call.
Accesses the metadata sent by the client.
The invocation metadata.
Identifies the peer that invoked the RPC being serviced.
A string identifying the peer that invoked the RPC being serviced. The string format is determined by gRPC runtime.
Gets one or more peer identity(s).
Equivalent to servicer_context.auth_context().get(servicer_context.peer_identity_key())
An iterable of the identities, or None if the call is not authenticated. Each identity is returned as a raw bytes type.
The auth property used to identify the peer.
For example, x509_common_name or x509_subject_alternative_name are used to identify an SSL peer.
The auth property (string) that indicates the peer identity, or None if the call is not authenticated.
Sends the initial metadata value to the client.
This method need not be called by implementations if they have no metadata to add to what the gRPC runtime will transmit.
initial_metadata The initial metadata.
Sets the value to be used as status code upon RPC completion.
This method need not be called by method implementations if they wish the gRPC runtime to determine the status code of the RPC.
code A StatusCode object to be sent to the client.
Set the compression algorithm to be used for the entire call.
compression An element of grpc.Compression, e.g. grpc.Compression.Gzip.
Sets the value to be used as detail string upon RPC completion.
This method need not be called by method implementations if they have no details to transmit.
details A UTF-8-encodable string to be sent to the client upon termination of the RPC.
Sets the trailing metadata for the RPC.
Sets the trailing metadata to be sent upon completion of the RPC.
If this method is invoked multiple times throughout the lifetime of an RPC, the value supplied in the final invocation will be the value sent over the wire.
This method need not be called by implementations if they have no metadata to add to what the gRPC runtime will transmit.
trailing_metadata The trailing metadata.
An implementation of a single RPC method.
Whether the RPC supports exactly one request message or any arbitrary number of request messages.
Whether the RPC supports exactly one response message or any arbitrary number of response messages.
A callable deserializer that accepts a byte string and returns an object suitable to be passed to this objects business logic, or None to indicate that this objects business logic should be passed the raw request bytes.
A callable serializer that accepts an object produced by this objects business logic and returns a byte string, or None to indicate that the byte strings produced by this objects business logic should be transmitted on the wire as they are.
This objects application-specific business logic as a callable value that takes a request value and a ServicerContext object and returns a response value. Only non-None if both request_streaming and response_streaming are False.
This objects application-specific business logic as a callable value that takes a request value and a ServicerContext object and returns an iterator of response values. Only non-None if request_streaming is False and response_streaming is True.
This objects application-specific business logic as a callable value that takes an iterator of request values and a ServicerContext object and returns a response value. Only non-None if request_streaming is True and response_streaming is False.
This objects application-specific business logic as a callable value that takes an iterator of request values and a ServicerContext object and returns an iterator of response values. Only non-None if request_streaming and response_streaming are both True.
Describes an RPC that has just arrived for service.
The method name of the RPC.
str
An implementation of RPC methods belonging to a service.
A service handles RPC methods with structured names of the form /Service.Name/Service.Method, where Service.Name is the value returned by service_name(), and Service.Method is the method name. A service can have multiple method names, but only a single service name.
Affords intercepting incoming RPCs on the service-side.
Intercepts incoming RPCs before handing them over to a handler.
State can be passed from an interceptor to downstream interceptors via contextvars. The first interceptor is called from an empty contextvars.Context, and the same Context is used for downstream interceptors and for the final handler call. Note that there are no guarantees that interceptors and handlers will be called from the same thread.
continuation A function that takes a HandlerCallDetails and proceeds to invoke the next interceptor in the chain, if any, or the RPC handler lookup logic, with the call details passed as an argument, and returns an RpcMethodHandler instance if the RPC is considered serviced, or None otherwise.
handler_call_details A HandlerCallDetails describing the RPC.
An RpcMethodHandler with which the RPC may be serviced if the interceptor chooses to service this RPC, or None otherwise.
Affords invoking a unary-unary RPC from client-side.
Synchronously invokes the underlying RPC.
request The request value for the RPC.
timeout An optional duration of time in seconds to allow for the RPC.
metadata Optional metadata to be transmitted to the service-side of the RPC.
credentials An optional CallCredentials for the RPC. Only valid for secure Channel.
wait_for_ready An optional flag to enable wait_for_ready mechanism.
compression An element of grpc.Compression, e.g. grpc.Compression.Gzip.
The response value for the RPC.
RpcError Indicating that the RPC terminated with non-OK status. The raised RpcError will also be a Call for the RPC affording the RPCs metadata, status code, and details.
Asynchronously invokes the underlying RPC.
request The request value for the RPC.
timeout An optional duration of time in seconds to allow for the RPC.
metadata Optional metadata to be transmitted to the service-side of the RPC.
credentials An optional CallCredentials for the RPC. Only valid for secure Channel.
wait_for_ready An optional flag to enable wait_for_ready mechanism.
compression An element of grpc.Compression, e.g. grpc.Compression.Gzip.
An object that is both a Call for the RPC and a Future. In the event of RPC completion, the return Call-Futures result value will be the response message of the RPC. Should the event terminate with non-OK status, the returned Call-Futures exception value will be an RpcError.
Synchronously invokes the underlying RPC.
request The request value for the RPC.
timeout An optional durating of time in seconds to allow for the RPC.
metadata Optional metadata to be transmitted to the service-side of the RPC.
credentials An optional CallCredentials for the RPC. Only valid for secure Channel.
wait_for_ready An optional flag to enable wait_for_ready mechanism.
compression An element of grpc.Compression, e.g. grpc.Compression.Gzip.
The response value for the RPC and a Call value for the RPC.
RpcError Indicating that the RPC terminated with non-OK status. The raised RpcError will also be a Call for the RPC affording the RPCs metadata, status code, and details.
Affords invoking a unary-stream RPC from client-side.
Invokes the underlying RPC.
request The request value for the RPC.
timeout An optional duration of time in seconds to allow for the RPC. If None, the timeout is considered infinite.
metadata An optional metadata to be transmitted to the service-side of the RPC.
credentials An optional CallCredentials for the RPC. Only valid for secure Channel.
wait_for_ready An optional flag to enable wait_for_ready mechanism.
compression An element of grpc.Compression, e.g. grpc.Compression.Gzip.
An object that is a Call for the RPC, an iterator of response values, and a Future for the RPC. Drawing response values from the returned Call-iterator may raise RpcError indicating termination of the RPC with non-OK status.
Affords invoking a stream-unary RPC from client-side.
Synchronously invokes the underlying RPC.
request_iterator An iterator that yields request values for the RPC.
timeout An optional duration of time in seconds to allow for the RPC. If None, the timeout is considered infinite.
metadata Optional metadata to be transmitted to the service-side of the RPC.
credentials An optional CallCredentials for the RPC. Only valid for secure Channel.
wait_for_ready An optional flag to enable wait_for_ready mechanism.
compression An element of grpc.Compression, e.g. grpc.Compression.Gzip.
The response value for the RPC.
RpcError Indicating that the RPC terminated with non-OK status. The raised RpcError will also implement grpc.Call, affording methods such as metadata, code, and details.
Asynchronously invokes the underlying RPC on the client.
request_iterator An iterator that yields request values for the RPC.
timeout An optional duration of time in seconds to allow for the RPC. If None, the timeout is considered infinite.
metadata Optional metadata to be transmitted to the service-side of the RPC.
credentials An optional CallCredentials for the RPC. Only valid for secure Channel.
wait_for_ready An optional flag to enable wait_for_ready mechanism.
compression An element of grpc.Compression, e.g. grpc.Compression.Gzip.
An object that is both a Call for the RPC and a Future. In the event of RPC completion, the return Call-Futures result value will be the response message of the RPC. Should the event terminate with non-OK status, the returned Call-Futures exception value will be an RpcError.
Synchronously invokes the underlying RPC on the client.
request_iterator An iterator that yields request values for the RPC.
timeout An optional duration of time in seconds to allow for the RPC. If None, the timeout is considered infinite.
metadata Optional metadata to be transmitted to the service-side of the RPC.
credentials An optional CallCredentials for the RPC. Only valid for secure Channel.
wait_for_ready An optional flag to enable wait_for_ready mechanism.
compression An element of grpc.Compression, e.g. grpc.Compression.Gzip.
The response value for the RPC and a Call object for the RPC.
RpcError Indicating that the RPC terminated with non-OK status. The raised RpcError will also be a Call for the RPC affording the RPCs metadata, status code, and details.
Affords invoking a stream-stream RPC on client-side.
Invokes the underlying RPC on the client.
request_iterator An iterator that yields request values for the RPC.
timeout An optional duration of time in seconds to allow for the RPC. If not specified, the timeout is considered infinite.
metadata Optional metadata to be transmitted to the service-side of the RPC.
credentials An optional CallCredentials for the RPC. Only valid for secure Channel.
wait_for_ready An optional flag to enable wait_for_ready mechanism.
compression An element of grpc.Compression, e.g. grpc.Compression.Gzip.
An object that is a Call for the RPC, an iterator of response values, and a Future for the RPC. Drawing response values from the returned Call-iterator may raise RpcError indicating termination of the RPC with non-OK status.
Indicates that the computation underlying a Future was cancelled.
A representation of a computation in another control flow.
Computations represented by a Future may be yet to be begun, may be ongoing, or may have already completed.
Adds a function to be called at completion of the computation.
The callback will be passed this Future object describing the outcome of the computation. Callbacks will be invoked after the future is terminated, whether successfully or not.
If the computation has already completed, the callback will be called immediately.
Exceptions raised in the callback will be logged at ERROR level, but will not terminate any threads of execution.
fn A callable taking this Future object as its single parameter.
Attempts to cancel the computation.
This method does not block.
Returns True if the computation was canceled.
Returns False under all other circumstances, for example:
computation has begun and could not be canceled.
computation has finished
to determine its state without blocking.
bool
Describes whether the computation was cancelled.
This method does not block.
Returns True if the computation was cancelled before its result became available.
Returns False under all other circumstances, for example:
computation was not cancelled.
computations result is available.
bool
Describes whether the computation has taken place.
This method does not block.
Returns True if the computation already executed or was cancelled. Returns False if the computation is scheduled for execution or currently executing. This is exactly opposite of the running() methods result.
bool
Return the exception raised by the computation.
This method may return immediately or may block.
timeout The length of time in seconds to wait for the computation to terminate or be cancelled. If None, the call will block until the computationss termination.
The exception raised by the computation, or None if the computation did not raise an exception.
FutureTimeoutError If a timeout value is passed and the computation does not terminate within the allotted time.
FutureCancelledError If the computation was cancelled.
Returns the result of the computation or raises its exception.
This method may return immediately or may block.
timeout The length of time in seconds to wait for the computation to finish or be cancelled. If None, the call will block until the computationss termination.
The return value of the computation.
FutureTimeoutError If a timeout value is passed and the computation does not terminate within the allotted time.
FutureCancelledError If the computation was cancelled.
Exception If the computation raised an exception, this call will raise the same exception.
Describes whether the computation is taking place.
This method does not block.
Returns True if the computation is scheduled for execution or currently executing.
Returns False if the computation already executed or was cancelled.
Access the traceback of the exception raised by the computation.
This method may return immediately or may block.
timeout The length of time in seconds to wait for the computation to terminate or be cancelled. If None, the call will block until the computations termination.
The traceback of the exception raised by the computation, or None if the computation did not raise an exception.
FutureTimeoutError If a timeout value is passed and the computation does not terminate within the allotted time.
FutureCancelledError If the computation was cancelled.
Indicates the compression method to be used for an RPC.
Do not use compression algorithm.
Use Deflate compression algorithm.
Use Gzip compression algorithm.
Returns a module generated by the indicated .proto file.
THIS IS AN EXPERIMENTAL API.
Use this function to retrieve classes corresponding to message definitions in the .proto file.
To inspect the contents of the returned module, use the dir function. For example:
`
protos = grpc.protos("foo.proto")
print(dir(protos))
`
The returned module object corresponds to the _pb2.py file generated by protoc. The path is expected to be relative to an entry on sys.path and all transitive dependencies of the file should also be resolvable from an entry on sys.path.
To completely disable the machinery behind this function, set the GRPC_PYTHON_DISABLE_DYNAMIC_STUBS environment variable to true.
protobuf_path The path to the .proto file on the filesystem. This path must be resolvable from an entry on sys.path and so must all of its transitive dependencies.
A module object corresponding to the message code for the indicated .proto file. Equivalent to a generated _pb2.py file.
Returns a module generated by the indicated .proto file.
THIS IS AN EXPERIMENTAL API.
Use this function to retrieve classes and functions corresponding to service definitions in the .proto file, including both stub and servicer definitions.
To inspect the contents of the returned module, use the dir function. For example:
`
services = grpc.services("foo.proto")
print(dir(services))
`
The returned module object corresponds to the _pb2_grpc.py file generated by protoc. The path is expected to be relative to an entry on sys.path and all transitive dependencies of the file should also be resolvable from an entry on sys.path.
To completely disable the machinery behind this function, set the GRPC_PYTHON_DISABLE_DYNAMIC_STUBS environment variable to true.
protobuf_path The path to the .proto file on the filesystem. This path must be resolvable from an entry on sys.path and so must all of its transitive dependencies.
A module object corresponding to the stub/service code for the indicated .proto file. Equivalent to a generated _pb2_grpc.py file.
Returns a 2-tuple of modules corresponding to protos and services.
THIS IS AN EXPERIMENTAL API.
The return value of this function is equivalent to a call to protos and a call to services.
To completely disable the machinery behind this function, set the GRPC_PYTHON_DISABLE_DYNAMIC_STUBS environment variable to true.
protobuf_path The path to the .proto file on the filesystem. This path must be resolvable from an entry on sys.path and so must all of its transitive dependencies.
A 2-tuple of module objects corresponding to (protos(path), services(path)).
| Web Proxy Viewer | New URL | Original Page |