本文整理了Java中retrofit2.Retrofit.callbackExecutor
方法的一些代码示例,展示了Retrofit.callbackExecutor
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Retrofit.callbackExecutor
方法的具体详情如下:
包路径:retrofit2.Retrofit
类名称:Retrofit
方法名:callbackExecutor
[英]The executor used for Callback methods on a Call. This may be null, in which case callbacks should be made synchronously on the background thread.
[中]用于调用回调方法的执行器。这可能是空的,在这种情况下,回调应该在后台线程上同步进行。
代码示例来源:origin: square/retrofit
@Override public @Nullable CallAdapter<?, ?> get(
Type returnType, Annotation[] annotations, Retrofit retrofit) {
if (getRawType(returnType) != MyCall.class) {
return null;
}
if (!(returnType instanceof ParameterizedType)) {
throw new IllegalStateException(
"MyCall must have generic type (e.g., MyCall<ResponseBody>)");
}
Type responseType = getParameterUpperBound(0, (ParameterizedType) returnType);
Executor callbackExecutor = retrofit.callbackExecutor();
return new ErrorHandlingCallAdapter<>(responseType, callbackExecutor);
}
代码示例来源:origin: com.microsoft.rest/client-runtime
this.credentials = restClient.builder.credentials;
if (restClient.retrofit.callbackExecutor() != null) {
this.withCallbackExecutor(restClient.retrofit.callbackExecutor());
内容来源于网络,如有侵权,请联系作者删除!