public BatchStream(ReadStream<Buffer> rs, WriteStream<Buffer> ws) { Objects.requireNonNull(rs, "ReadStream"); Objects.requireNonNull(ws, "WriteStream"); recordParser = RecordParser.newFixed(4, rs); writeStream = ws; // Propagate exceptions to the current stream recordParser.exceptionHandler(throwable -> { if (exceptionHandler != null) { exceptionHandler.handle(throwable); } }); writeStream.exceptionHandler(throwable -> { if (exceptionHandler != null) { exceptionHandler.handle(throwable); } }); }
if (ar.succeeded()) { WriteStream<Buffer> ws = ar.result(); ws.exceptionHandler(t -> fail(t.getMessage())); ws.write(buff); ar.result().close(ar2 -> {
if (ar.succeeded()) { WriteStream<Buffer> ws = ar.result(); ws.exceptionHandler(t -> fail(t.getMessage())); for (int i = 0; i < chunks; i++) { Buffer chunk = buff.getBuffer(i * chunkSize, (i + 1) * chunkSize);
@Override public WriteStream<Buffer> exceptionHandler(Handler<Throwable> handler) { stream.exceptionHandler(handler); return this; }
CompletableFuture<Void> readFuture = new CompletableFuture<>(); writeStream.exceptionHandler(e -> {
/** * Set an exception handler on the write stream. * @param handler the exception handler * @return a reference to this, so the API can be used fluently */ public io.vertx.rxjava.core.streams.WriteStream<T> exceptionHandler(Handler<Throwable> handler) { delegate.exceptionHandler(handler); return this; }
@Override public WriteStream<Buffer> exceptionHandler(Handler<Throwable> handler) { stream.exceptionHandler(handler); return this; }
/** * Set an exception handler on the write stream. * @param handler the exception handler * @return a reference to this, so the API can be used fluently */ public io.vertx.rxjava.core.streams.WriteStream<T> exceptionHandler(Handler<Throwable> handler) { delegate.exceptionHandler(handler); return this; }
if (ar.succeeded()) { WriteStream<Buffer> ws = ar.result(); ws.exceptionHandler(t -> fail(t.getMessage())); ws.write(buff); ar.result().close(ar2 -> {
@Override public GzipWriteStream exceptionHandler(Handler<Throwable> handler) { exceptionHandler = handler; delegate.exceptionHandler(handler); return this; }
@Override public WriteStream<Buffer> exceptionHandler(Handler<Throwable> handler) { wrappedWriteStream.exceptionHandler(handler); return this; }
if (ar.succeeded()) { WriteStream<Buffer> ws = ar.result(); ws.exceptionHandler(t -> fail(t.getMessage())); for (int i = 0; i < chunks; i++) { Buffer chunk = buff.getBuffer(i * chunkSize, (i + 1) * chunkSize);
@Override public void onSubscribe(Disposable disposable) { Objects.requireNonNull(disposable, "disposable"); if (!setDisposable(disposable)) { disposable.dispose(); DisposableHelper.reportDisposableSet(); return; } writeStream.exceptionHandler(t -> { if (!setDone()) { RxJavaPlugins.onError(t); return; } getDisposable().dispose(); Consumer<? super Throwable> c; synchronized (this) { c = this.writeStreamExceptionHandler; } if (c != null) { try { c.accept(t); } catch (Exception e) { RxJavaPlugins.onError(t); } } }); }
CompletableFuture<Void> readFuture = new CompletableFuture<>(); writeStream.exceptionHandler(e -> {
@Override public void onSubscribe(Subscription subscription) { Objects.requireNonNull(subscription, "subscription"); if (!setSubscription(subscription)) { subscription.cancel(); SubscriptionHelper.reportSubscriptionSet(); return; } writeStream.exceptionHandler(t -> { if (!setDone()) { RxJavaPlugins.onError(t); return; } getSubscription().cancel(); Consumer<? super Throwable> c; synchronized (this) { c = this.writeStreamExceptionHandler; } if (c != null) { try { c.accept(t); } catch (Exception e) { RxJavaPlugins.onError(e); } } }); writeStream.drainHandler(v -> requestMore()); requestMore(); }
}; file.exceptionHandler(exceptionHandler); out.exceptionHandler(exceptionHandler);