Search in sources :

Example 1 with MycatReactorThread

use of io.mycat.proxy.reactor.MycatReactorThread in project Mycat2 by MyCATApache.

the class MySQLAPIRuntimeImpl method addPengdingJob.

@Override
public void addPengdingJob(MySQLJobCallback callback) {
    MycatReactorThread thread = (MycatReactorThread) Thread.currentThread();
    thread.addNIOJob(new NIOJob() {

        @Override
        public void run(ReactorEnvThread reactor) throws Exception {
            callback.run();
        }

        @Override
        public void stop(ReactorEnvThread reactor, Exception reason) {
            callback.stop(reason);
        }

        @Override
        public String message() {
            return callback.message();
        }
    });
}
Also used : ReactorEnvThread(io.mycat.proxy.reactor.ReactorEnvThread) MycatReactorThread(io.mycat.proxy.reactor.MycatReactorThread) NIOJob(io.mycat.proxy.reactor.NIOJob)

Aggregations

MycatReactorThread (io.mycat.proxy.reactor.MycatReactorThread)1 NIOJob (io.mycat.proxy.reactor.NIOJob)1 ReactorEnvThread (io.mycat.proxy.reactor.ReactorEnvThread)1