本文整理了Java中rx.Observable.concatWith()
方法的一些代码示例,展示了Observable.concatWith()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Observable.concatWith()
方法的具体详情如下:
包路径:rx.Observable
类名称:Observable
方法名:concatWith
[英]Returns an Observable that emits the items emitted from the current Observable, then the next, one after the other, without interleaving them.
Scheduler: concat does not operate by default on a particular Scheduler.
[中]返回一个Observable,该Observable发出从当前Observable发出的项,然后是下一个Observable,一个接一个,而不交错它们。
调度器:默认情况下,concat不会在特定的调度器上运行。
代码示例来源:origin: PipelineAI/pipeline
@Override
protected Observable<Integer> construct() {
return Observable.just(1, 2, 3)
.concatWith(Observable.<Integer> error(new RuntimeException("forced error")))
.subscribeOn(Schedulers.computation());
}
代码示例来源:origin: com.microsoft.azure/azure-mgmt-resources
@Override
public Observable<ServiceResponse<Page<SubscriptionInner>>> call(ServiceResponse<Page<SubscriptionInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink));
}
});
代码示例来源:origin: com.microsoft.azure/azure-mgmt-resources
@Override
public Observable<ServiceResponse<Page<PolicySetDefinitionInner>>> call(ServiceResponse<Page<PolicySetDefinitionInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink));
}
});
代码示例来源:origin: PipelineAI/pipeline
@Override
protected Observable<Boolean> construct() {
return Observable.just(false, true, false)
.concatWith(Observable.<Boolean>error(new RuntimeException("forced error")))
.subscribeOn(Schedulers.computation());
}
代码示例来源:origin: com.microsoft.azure/azure-mgmt-resources
@Override
public Observable<ServiceResponse<Page<PolicySetDefinitionInner>>> call(ServiceResponse<Page<PolicySetDefinitionInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listBuiltInNextWithServiceResponseAsync(nextPageLink));
}
});
代码示例来源:origin: davidmoten/rxjava-jdbc
/**
* Sets a named parameter. If name is null throws a
* {@link NullPointerException}. If value is instance of Observable then
* throws an {@link IllegalArgumentException}.
*
* @param name
* the parameter name. Cannot be null.
* @param value
* the parameter value
*/
void parameter(String name, Object value) {
Preconditions.checkNotNull(name, "parameter name cannot be null");
if (value instanceof Observable)
throw new IllegalArgumentException(
"use parameters() method not the parameter() method for an Observable");
this.parameters = parameters.concatWith(Observable.just(new Parameter(name, value)));
}
代码示例来源:origin: com.microsoft.azure/azure-mgmt-resources
@Override
public Observable<ServiceResponse<Page<ProviderInner>>> call(ServiceResponse<Page<ProviderInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink));
}
});
代码示例来源:origin: jhusain/learnrxjava
Observable.just("Hello", "World!")
.subscribe(System.out::println);
System.out.println("delay retry by " + i + " second(s)");
return Observable.timer(i, TimeUnit.SECONDS);
}).concatWith(Observable.error(new RuntimeException("Exceeded 3 retries")));
})
.subscribe(System.out::println, t -> t.printStackTrace());
代码示例来源:origin: com.microsoft.azure/azure-mgmt-resources
@Override
public Observable<ServiceResponse<Page<PolicyDefinitionInner>>> call(ServiceResponse<Page<PolicyDefinitionInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listByManagementGroupNextWithServiceResponseAsync(nextPageLink));
}
});
代码示例来源:origin: com.microsoft.azure/azure-mgmt-resources
@Override
public Observable<ServiceResponse<Page<FeatureResultInner>>> call(ServiceResponse<Page<FeatureResultInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(list1NextWithServiceResponseAsync(nextPageLink));
}
});
代码示例来源:origin: com.microsoft.azure/azure-mgmt-resources
@Override
public Observable<ServiceResponse<Page<TagDetailsInner>>> call(ServiceResponse<Page<TagDetailsInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink));
}
});
代码示例来源:origin: com.microsoft.azure/azure-mgmt-resources
@Override
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> call(ServiceResponse<Page<PolicyAssignmentInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listForResourceNextWithServiceResponseAsync(nextPageLink));
}
});
代码示例来源:origin: com.microsoft.azure/azure-mgmt-resources
@Override
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> call(ServiceResponse<Page<PolicyAssignmentInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink));
}
});
代码示例来源:origin: com.microsoft.azure/azure-mgmt-resources
@Override
public Observable<ServiceResponse<Page<SubscriptionInner>>> call(ServiceResponse<Page<SubscriptionInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink));
}
});
代码示例来源:origin: com.microsoft.azure/azure-mgmt-resources
@Override
public Observable<ServiceResponse<Page<PolicySetDefinitionInner>>> call(ServiceResponse<Page<PolicySetDefinitionInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listByManagementGroupNextWithServiceResponseAsync(nextPageLink));
}
});
代码示例来源:origin: com.microsoft.azure/azure-mgmt-resources
@Override
public Observable<ServiceResponse<Page<PolicySetDefinitionInner>>> call(ServiceResponse<Page<PolicySetDefinitionInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listByManagementGroupNextWithServiceResponseAsync(nextPageLink));
}
});
代码示例来源:origin: com.microsoft.azure/azure-mgmt-resources
@Override
public Observable<ServiceResponse<Page<ResourceGroupInner>>> call(ServiceResponse<Page<ResourceGroupInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink));
}
});
代码示例来源:origin: com.microsoft.azure/azure-mgmt-resources
@Override
public Observable<ServiceResponse<Page<PolicyDefinitionInner>>> call(ServiceResponse<Page<PolicyDefinitionInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listBuiltInNextWithServiceResponseAsync(nextPageLink));
}
});
代码示例来源:origin: com.microsoft.azure/azure-mgmt-resources
@Override
public Observable<ServiceResponse<Page<PolicyDefinitionInner>>> call(ServiceResponse<Page<PolicyDefinitionInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listByManagementGroupNextWithServiceResponseAsync(nextPageLink));
}
});
代码示例来源:origin: com.microsoft.azure/azure-mgmt-resources
@Override
public Observable<ServiceResponse<Page<TenantIdDescriptionInner>>> call(ServiceResponse<Page<TenantIdDescriptionInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink));
}
});
内容来源于网络,如有侵权,请联系作者删除!