Distractic
04/15/2024, 5:03 PMdefaultRequest
plugin, I need to retrieve a value that's protected by a Mutex.
defaultRequest {
url(baseUrl)
// headerBuilder needs to be called in suspend function
headerBuilder().forEach { (key, value) ->
header(key, value)
}
}
However, the builder doesn't support suspend context.
Instead of Mutex, there is the lock
but that will block the thread and I don't want to have performance issue.
I'm in a multiplatform context so I don't have the Runblocking function.
Do you have a solution about that? 🤔Aleksei Tirman [JB]
04/15/2024, 7:36 PMheaderBuilder()
return different values at different times?Distractic
04/15/2024, 9:03 PMAleksei Tirman [JB]
04/16/2024, 8:11 AMurl
method) ?Distractic
04/16/2024, 12:09 PMAleksei Tirman [JB]
04/16/2024, 3:11 PMDistractic
04/17/2024, 7:21 AMDistractic
04/17/2024, 7:24 AMDistractic
04/17/2024, 7:24 AM