https://kotlinlang.org logo
#coroutines
Title
# coroutines
s

savrov

09/09/2019, 7:32 PM
Hello, with Ktor Client i want to archive secure http requests. The idea is: 1. make a request 2. response code equals to 401 3. stop all other request and make them wait for response from auth endpoint (ex: refresh token) 4. receive new token 5. rerun request from 1 step and resume all “pending” request from step 3. I think I can archive it with
ConflatedBroadcastChannel
, but i dont know how to do it. Pls share with your thoughts
d

Dominaezzz

09/09/2019, 8:58 PM
What do you mean by, stopping a request?
l

louiscad

09/10/2019, 6:13 AM
They probably mean cancel and retry after refresh, under the hood.
s

savrov

09/10/2019, 6:29 AM
Yes, stop and retry after token is refreshed
4 Views