rx.Observable.toCompletable()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(118)

本文整理了Java中rx.Observable.toCompletable()方法的一些代码示例,展示了Observable.toCompletable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Observable.toCompletable()方法的具体详情如下:
包路径:rx.Observable
类名称:Observable
方法名:toCompletable

Observable.toCompletable介绍

暂无

代码示例

代码示例来源:origin: amitshekhariitbhu/Fast-Android-Networking

public <T> Completable getParseCompletable(TypeToken<T> typeToken) {
  return getParseObservable(typeToken).toCompletable();
}

代码示例来源:origin: amitshekhariitbhu/Fast-Android-Networking

public <T> Completable getObjectListCompletable(Class<T> objectClass) {
  return getObjectListObservable(objectClass).toCompletable();
}

代码示例来源:origin: amitshekhariitbhu/Fast-Android-Networking

public Completable getBitmapCompletable() {
  return getBitmapObservable().toCompletable();
}

代码示例来源:origin: amitshekhariitbhu/Fast-Android-Networking

public Completable getDownloadCompletable() {
  return getDownloadObservable().toCompletable();
}

代码示例来源:origin: amitshekhariitbhu/Fast-Android-Networking

public Completable getJSONObjectCompletable() {
  return getJSONObjectObservable().toCompletable();
}

代码示例来源:origin: amitshekhariitbhu/Fast-Android-Networking

public Completable getJSONArrayCompletable() {
  return getJSONArrayObservable().toCompletable();
}

代码示例来源:origin: amitshekhariitbhu/Fast-Android-Networking

public Completable getStringCompletable() {
  return getStringObservable().toCompletable();
}

代码示例来源:origin: amitshekhariitbhu/Fast-Android-Networking

public <T> Completable getObjectCompletable(Class<T> objectClass) {
  return getObjectObservable(objectClass).toCompletable();
}

代码示例来源:origin: PipelineAI/pipeline

private Object mapObservable(Observable observable, final MetaHolder metaHolder) {
  if (Completable.class.isAssignableFrom(metaHolder.getMethod().getReturnType())) {
    return observable.toCompletable();
  } else if (Single.class.isAssignableFrom(metaHolder.getMethod().getReturnType())) {
    return observable.toSingle();
  }
  return observable;
}

代码示例来源:origin: jeasonlzy/okhttp-OkGo

@Override
  public Completable adapt(Call<T> call, AdapterParam param) {
    ObservableResponse<T> body = new ObservableResponse<>();
    return body.adapt(call, param).toCompletable();
  }
}

代码示例来源:origin: square/retrofit

@Override public Object adapt(Call<R> call) {
  OnSubscribe<Response<R>> callFunc = isAsync
    ? new CallEnqueueOnSubscribe<>(call)
    : new CallExecuteOnSubscribe<>(call);

  OnSubscribe<?> func;
  if (isResult) {
   func = new ResultOnSubscribe<>(callFunc);
  } else if (isBody) {
   func = new BodyOnSubscribe<>(callFunc);
  } else {
   func = callFunc;
  }
  Observable<?> observable = Observable.create(func);

  if (scheduler != null) {
   observable = observable.subscribeOn(scheduler);
  }

  if (isSingle) {
   return observable.toSingle();
  }
  if (isCompletable) {
   return observable.toCompletable();
  }
  return observable;
 }
}

代码示例来源:origin: PipelineAI/pipeline

@HystrixCommand
public Completable getCompletableUser(final String id, final String name) {
  validate(id, name, "getCompletableUser has failed");
  return createObservable(id, name).toCompletable();
}

代码示例来源:origin: com.microsoft.azure/azure-mgmt-resources

@Override
public Completable deleteByIdAsync(final String id) {
  final ResourcesInner inner = this.inner();
  return getApiVersionFromId(id)
      .flatMap(new Func1<String, Observable<Void>>() {
        @Override
        public Observable<Void> call(String apiVersion) {
          return inner.deleteByIdAsync(id, apiVersion);
        }
      }).toCompletable();
}

代码示例来源:origin: com.microsoft.azure/azure-mgmt-network

@Override
public Completable startAsync() {
  return this.client.startAsync(parent.resourceGroupName(), parent.name(), name())
      .flatMap(new Func1<Void, Observable<?>>() {
        @Override
        public Observable<?> call(Void aVoid) {
          return refreshAsync();
        }
      }).toCompletable();
}

代码示例来源:origin: hawkular/hawkular-metrics

private void unscheduleDeleteExpiredMetrics() {
  String jobName = "DELETE_EXPIRED_METRICS";
  String configId = "org.hawkular.metrics.jobs.DELETE_EXPIRED_METRICS";
  // We load the configuration first so that delete is done only if it exists in order to avoid generating
  // tombstones.
  Completable deleteConfig = configurationService.load(configId)
      .map(config -> configurationService.delete(configId))
      .toCompletable();
  // unscheduleJobByTypeAndName will not generate unnecessary tombstones as it does reads before writes
  Completable unscheduleJob = scheduler.unscheduleJobByTypeAndName(jobName, jobName);
  Completable.merge(deleteConfig, unscheduleJob).await();
}

代码示例来源:origin: hawkular/hawkular-metrics

private Completable deleteScheduledJobs(Date timeSlice) {
  return session.execute(deleteScheduledJobs.bind(timeSlice), queryScheduler)
      .doOnCompleted(() -> logger.debugf("Deleted scheduled jobs time slice [%s]", timeSlice))
      .toCompletable();
}

代码示例来源:origin: hawkular/hawkular-metrics

private Completable deleteFinishedJobs(Date timeSlice) {
  return session.execute(deleteFinishedJobs.bind(timeSlice), queryScheduler)
      .doOnCompleted((() -> logger.debugf("Deleted finished jobs time slice [%s]", timeSlice)))
      .toCompletable();
}

代码示例来源:origin: com.microsoft.azure/azure-mgmt-resources

@Override
public Completable moveResourcesAsync(String sourceResourceGroupName, ResourceGroup targetResourceGroup, List<String> resources) {
  ResourcesMoveInfoInner moveInfo = new ResourcesMoveInfoInner();
  moveInfo.withTargetResourceGroup(targetResourceGroup.id());
  moveInfo.withResources(resources);
  return this.inner().moveResourcesAsync(sourceResourceGroupName, moveInfo).toCompletable();
}

代码示例来源:origin: hawkular/hawkular-metrics

public void prepareJobDetailsForExecution(JobDetailsImpl jobDetails, Date timeSlice) {
  if (jobDetails.getJobId() == null || jobDetails.getJobType() == null ||
      jobDetails.getJobName() == null || jobDetails.getTrigger() == null) {
    logger.warn("Tried to prepare job for execution with invalid values");
  }
  Function<Map<String, String>, Completable> saveParameters = params ->
      session.execute(updateJobParameters.bind(jobDetails.getParameters().getMap(), timeSlice,
          jobDetails.getJobId())).toCompletable();
  jobDetails.setSaveParameters(saveParameters);
}

代码示例来源:origin: com.microsoft.azure/azure-mgmt-network

@Override
  public Completable deleteByIdAsync(String id) {
    ResourceId resourceId = ResourceId.fromString(id);
    return this.inner().deleteAsync(resourceId.resourceGroupName(), resourceId.parent().name(), resourceId.name()).toCompletable();
  }
}

相关文章

Observable类方法