本文整理匯總了Java中io.reactivex.Completable.fromPublisher方法的典型用法代碼示例。如果您正苦於以下問題:Java Completable.fromPublisher方法的具體用法?Java Completable.fromPublisher怎麽用?Java Completable.fromPublisher使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類io.reactivex.Completable
的用法示例。
在下文中一共展示了Completable.fromPublisher方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: execute
import io.reactivex.Completable; //導入方法依賴的package包/類
@Override
public Completable execute() {
DocumentsLoader loader = new DocumentsLoader(client, params);
loader.setFieldsReader(userColumns ? new ReflectionDeviceReader() : new PredefinedDeviceReader());
loader.setDeviceListCache(cache);
TablePrinter tablePrinter = new TablePrinter(loader.getColumnNames());
return Completable.fromPublisher(
loader.loadDevices()
.doOnNext(tablePrinter::addDevice)
.doOnComplete(() -> tablePrinter.print(output)));
}
示例2: fromRunnable
import io.reactivex.Completable; //導入方法依賴的package包/類
public static Completable fromRunnable(final UnsafeRunnable runnable) {
Preconditions.checkNotNull(runnable);
return Completable.fromPublisher(subscriber -> {
try {
runnable.run();
subscriber.onComplete();
} catch (final Throwable throwable) {
subscriber.onError(throwable);
}
});
}
示例3: connect
import io.reactivex.Completable; //導入方法依賴的package包/類
Completable connect() {
return Completable.fromPublisher(createConnectionPublisher());
}
示例4: execute
import io.reactivex.Completable; //導入方法依賴的package包/類
@Override
public Completable execute() {
return Completable.fromPublisher(client.disconnectFromAllDevices().doOnNext(this::handle));
}
示例5: store
import io.reactivex.Completable; //導入方法依賴的package包/類
@Override public Completable store(T value) {
return Completable.fromPublisher(depositor.store(value));
}
示例6: delete
import io.reactivex.Completable; //導入方法依賴的package包/類
@Override public Completable delete() {
return Completable.fromPublisher(depositor.delete());
}
示例7: deleteAllRx
import io.reactivex.Completable; //導入方法依賴的package包/類
/**
* Same as {@link #deleteAll()} but wrapped in a {@link Completable}.
*
* @return Completable that when subscribed will preform the delete operation.
*/
public Completable deleteAllRx() {
return Completable.fromPublisher(hoard.deleteAllReactive());
}