dio icon indicating copy to clipboard operation
dio copied to clipboard

Request for clarification on QueuedInterceptor example

Open vasilich6107 opened this issue 1 year ago • 0 comments

New Issue Checklist

  • [x] I have searched for a similar issue in the project and found none

Issue Info

Hi. You have this example for queued interceptor.

https://github.com/flutterchina/dio/blob/a4392ff8412bfe1e3e86ae45f81fe1fc117bc56e/example/lib/queued_interceptor_crsftoken.dart

Issue Description and Steps

onError you are requesting new token with different Dio client called tokenDio https://github.com/flutterchina/dio/blob/a4392ff8412bfe1e3e86ae45f81fe1fc117bc56e/example/lib/queued_interceptor_crsftoken.dart#L48

Does this mean that dio client is paused?

If the main dio client is paused why do you retry the failed request with dio client https://github.com/flutterchina/dio/blob/a4392ff8412bfe1e3e86ae45f81fe1fc117bc56e/example/lib/queued_interceptor_crsftoken.dart#L53

Looks a little bit confusing.

Could you clarify why it works? Why we can do retry with the same client but have to request token with different one?

vasilich6107 avatar Aug 11 '22 11:08 vasilich6107