On Sat, Sep 2, 2017 at 1:24 AM, Amit Saha <[email protected]> wrote:

> I can set call specific timeout as follows:
>
> response = stub.CreateUser(
>             users_messages.CreateUserRequest(username='tom'),
>             metadata=metadata,
>             timeout=30,
>  )
>
> Is it possible to set timeout when creating the stub (so that i don't have
> to set the timeout per call)? I could create a wrapper to do this
> automatically, something like this i guess:
>
> def wrapped_client(stub, method, data, metadata):
>     # not sure if this actually works..more of an idea
>     getattr(stub, method)(data, metadata=metadata,timeout=30)
>
> and then always use this wrapper.
>

This is not possible today with gRPC Python. It's likely coming in the
future, either with interceptors support
<https://github.com/grpc/grpc/issues/8767> or some other mechanism.
-Nathaniel

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CAEOYnARvJk3M%3DZ6tPrdaPqCGTk%3DdZiw%2Bd9UtMSCjBMpGiXZyng%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to