/** * Close the file. The actual close happens asynchronously. * The handler will be called when the close is complete, or an error occurs. * @return * @deprecated use {@link #rxClose} instead */ @Deprecated() public Observable<Void> closeObservable() { io.vertx.rx.java.ObservableFuture<Void> handler = io.vertx.rx.java.RxHelper.observableFuture(); close(handler.toHandler()); return handler; }
/** * Close the file. The actual close happens asynchronously. * The handler will be called when the close is complete, or an error occurs. * @return */ public Single<Void> rxClose() { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { close(fut); })); }
/** * Close the file. The actual close happens asynchronously. * The handler will be called when the close is complete, or an error occurs. * @return */ public Single<Void> rxClose() { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { close(fut); })); }
.doAfterTerminate(() -> { file.flush(); file.close(); }) .toSingleDefault(archivePath);