Closed fxsjy closed 6 years ago
Assuming you use the HttpPostClientTransport, you would do so using the transport that you pass to the client.
endpoint = 'http://example.com/jsonrpc/2.0/'
rpc_client = RPCClient(
JSONRPCProtocol(),
HttpPostClientTransport(endpoint)
)
You would have to extend the construction of the transport like this:
HttpPostClientTransport(endpoint, timeout=0.1)
In case a time out happens you'd get a requests.exceptions.Timeout
exception.
does zmqprotocol also support this option?
No but you might use the green variant of zmq. Please check the documentation of zmq.green and tinyrpc 0mq. The source of tinyrpc's zmq transport may also provide hints.
thanks,I will try zmq.green later.
Is there a way to set timeout value for the client to call service. When server crash, the client will be blocked forever.