can a context be notified that it's call was aborted (network failure)

24 views
Skip to first unread message

Elhanan Maayan

unread,
Aug 1, 2019, 2:09:40 PM8/1/19
to grpc.io
hi..
i have a  streaming call that i'd like to run under a specific context. (in order to cancel it later) 

the onError of the observer give me that status error in case of a network failure. 
what i'd like to do  is automatically create another call to the same destination, however the only way that could happen is if i invoke it from the onError of the observer 
so i will basically have an observer that will create itself each time a failure happens. 

the 2nd question is it possible to reuse the same context that had it's called failed with on Error?


Kun Zhang

unread,
Aug 7, 2019, 2:16:08 PM8/7/19
to grpc.io


On Thursday, August 1, 2019 at 11:09:40 AM UTC-7, Elhanan Maayan wrote:
hi..
i have a  streaming call that i'd like to run under a specific context. (in order to cancel it later) 

the onError of the observer give me that status error in case of a network failure. 
what i'd like to do  is automatically create another call to the same destination, however the only way that could happen is if i invoke it from the onError of the observer 
so i will basically have an observer that will create itself each time a failure happens. 

This seems fine.
 

the 2nd question is it possible to reuse the same context that had it's called failed with on Error?



Yes, as long as the Context is not cancelled, it can be re-used. 
Reply all
Reply to author
Forward
0 new messages