New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set timeout of objective rpc request? #4585
Comments
I'm also curious as to how to best handle timeouts on the iOS port. By default it seems that it's indefinite and no error is sprung. Or maybe should it be tackled from the other side, ie. the server? |
Hi guys, sorry for the delay replying! There's an unimplemented feature request (#2114) for setting timeouts easily. Until it's implemented, it has to be done "the hard way", i.e., start a timeout yourself when starting the call, and have it cancel the request when it triggers. Which is probably a bit of a PITA. For things like Internet becoming unreachable, I'm working this week on implementing #4064, which will take care of those conditions better than setting timeouts. As Wojtek says, implementing the timeout in the server is another possibility (and it's probably a good idea anyway, no matter what's done on the client). |
I am facing the same issue regarding unable to set the timeout. You mentioned we can cancel the GRPC request. How can we do so? |
You can see an example here: https://github.com/grpc/grpc/blob/master/src/objective-c/tests/InteropTests.m#L269 |
I tried compiling that project; however, the pod install fails with the following error message: Installing BoringSSL (2.0) /bin/bash: line 5: ../../../../bins//protobuf/protoc: No such file or directory |
@sp71 That example project is a bit old, so the environment vars may have changed since then. If it can't find protoc, check if it's really there where it expects it (the PROTOC environment var in the script). If it's at a different location in your setup, change appropriately. Ideally, I wouldn't try and compile that example project. I'd just take the code shown which enables using timeouts and place it into your working code. |
Yeah, that project, specifically, is for testing, and the script to run the tests sets |
We should support setting a deadline or timeout as part of objc API. |
Closing this issue because it's tracked somewhere else. |
@jcanizales, did you mean to link to #9555? |
I think it was #2114 . |
I need to set timeout of each request, how can i do this in objective-c?
The text was updated successfully, but these errors were encountered: