本文整理汇总了Java中io.vertx.core.streams.Pump.start方法的典型用法代码示例。如果您正苦于以下问题:Java Pump.start方法的具体用法?Java Pump.start怎么用?Java Pump.start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.vertx.core.streams.Pump
的用法示例。
在下文中一共展示了Pump.start方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toReadStream
import io.vertx.core.streams.Pump; //导入方法依赖的package包/类
public void toReadStream(io.vertx.rxjava.core.Vertx vertx, HttpServerResponse response) {
Observable<Buffer> observable = getObservable();
ReadStream<Buffer> readStream = RxHelper.toReadStream(observable);
Pump pump = Pump.pump(readStream, response);
pump.start();
}
示例2: toReadStream
import io.vertx.core.streams.Pump; //导入方法依赖的package包/类
public void toReadStream(HttpServerResponse response) {
Flowable<Buffer> observable = getFlowable();
ReadStream<Buffer> readStream = FlowableHelper.toReadStream(observable);
Pump pump = Pump.pump(readStream, response);
pump.start();
}
示例3: example1
import io.vertx.core.streams.Pump; //导入方法依赖的package包/类
public void example1(HttpServerResponse response, Publisher<Buffer> otherPublisher) {
ReactiveReadStream<Buffer> rrs = ReactiveReadStream.readStream();
// Subscribe the read stream to the publisher
otherPublisher.subscribe(rrs);
// Pump from the read stream to the http response
Pump pump = Pump.pump(rrs, response);
pump.start();
}
示例4: example2
import io.vertx.core.streams.Pump; //导入方法依赖的package包/类
public void example2(Vertx vertx, HttpServerRequest request, Subscriber<Buffer> otherSubscriber) {
ReactiveWriteStream<Buffer> rws = ReactiveWriteStream.writeStream(vertx);
// Subscribe the other subscriber to the write stream
rws.subscribe(otherSubscriber);
// Pump the http request to the write stream
Pump pump = Pump.pump(request, rws);
pump.start();
}