Example usage for io.netty.channel EventLoopGroup submit

List of usage examples for io.netty.channel EventLoopGroup submit

Introduction

In this page you can find the example usage for io.netty.channel EventLoopGroup submit.

Prototype

@Override
    Future<?> submit(Runnable task);

Source Link

Usage

From source file:io.nodyn.loop.Blocking.java

License:Apache License

public void unblock(final Runnable action) {
    final EventLoopGroup elg = managedLoop.getEventLoopGroup();
    final RefHandle refHandle = managedLoop.newHandle();
    elg.submit(new Runnable() {
        @Override//from  w  w  w . jav  a  2s. c o  m
        public void run() {
            try {
                action.run();
            } finally {
                refHandle.unref();
            }

        }
    });
}