Tag: performance

如何获取RxJava 2自定义运算符上的RetroFit请求的URL和方法?

所以我正在尝试为Http请求集成Firebase性能,并像这里显示的那样手动添加它们(步骤9)。 我正在使用Retrofit 2和RxJava 2,所以我有做一个自定义运算符的想法,检查下面的代码: 改造2客户端 @GET(“branch-{environment}/v2/branches”) fun getBranch(@Path(“environment”) environment: String, @Query(“location”) location: String, @Query(“fulfilment_type”) fulfilmentType: String): Single<Response> RxJava呼叫改造客户端 private val client: BranchClient = clientFactory.create(urlProvider.apiUrl) override fun getBranch(postCode: String, fulfilmentType: FulfilmentType): Single { return client .getBranch(environment, postCode.toUpperCase(), fulfilmentType.toString()) .lift(RxHttpPerformanceSingleOperator(URL?, METHOD?)) .map { it.body() } .subscribeIO() //custom Kotlin extension .observeMain() //custom Kotlin extension … } RxJava 2自定义操作员通过电梯: […]