Colton Idle
02/23/2023, 10:20 PMralf
02/23/2023, 10:20 PMColton Idle
02/23/2023, 10:23 PMInterceptor
types, but I can maybe check to see what concrete type it actually is... and if it's something important where ordering matters, then I can re-order it by hand before i pass it into my okhttp client in the app module.ephemient
02/23/2023, 10:38 PMdata class PrioritizedInterceptor(
val priority: Int,
val interceptor: Interceptor,
)
@[Provides IntoSet] fun first() = PrioritizedInterceptor(0, OuterInterceptor)
@[Provides IntoSet] fun last() = PrioritizedInterceptor(Int.MAX_VALUE, InnerInterceptor)
@Inject constructor(interceptors: Set<@JvmSuppressWildcards PrioritizedInterceptor>) {
for ((_, interceptor) in interceptors.sortedBy { it.priority }) {
addInterceptor(interceptor)
Colton Idle
02/23/2023, 10:39 PMephemient
02/23/2023, 10:43 PMColton Idle
02/23/2023, 10:52 PMephemient
02/23/2023, 10:55 PMnewBuilder()
from the shared client, it'll let you build a new instance while sharing the executor etc. (as the docs say)Colton Idle
02/23/2023, 11:03 PMDaniel Perez
02/24/2023, 7:22 PMColton Idle
02/25/2023, 7:03 PMDaniel Perez
02/25/2023, 7:04 PMColton Idle
02/25/2023, 7:04 PMursus
03/04/2023, 9:04 PMPriority(1, FooInterceptor())