use of io.mycat.mysqlclient.command.ResponseBufferCommand in project Mycat2 by MyCATApache.
the class VertxConnection method query.
public Observable<Buffer> query(String sql) {
Observable<Buffer> objectObservable = Observable.create(emitter -> {
synchronized (VertxConnection.this) {
future = future.flatMap(new Function<Void, Future<Void>>() {
@Override
public Future<Void> apply(Void unused) {
return Future.future((promise) -> {
checkException();
ResponseBufferCommand bufferedResponseHandler = new ResponseBufferCommand(netSocket, sql, config, !NewMycatConnectionConfig.PASS_HALF_PACKET, emitter) {
@Override
public void onEnd() {
super.onEnd();
promise.tryComplete();
}
};
netSocket.handler(bufferedResponseHandler);
bufferedResponseHandler.write();
});
}
});
}
});
return objectObservable;
}
Aggregations