Retrying the request using Retrofit 2

后端 未结 7 933
天涯浪人
天涯浪人 2020-12-12 17:35

How can I add retry functionality to the requests sent by Retrofit 2 library. Something like:

service.listItems().enqueue(new Callback>         


        
7条回答
  •  死守一世寂寞
    2020-12-12 18:05

    Go with RxJava Observable and call retry() Doc: https://github.com/ReactiveX/RxJava/wiki/Error-Handling-Operators

提交回复
热议问题