@@ -0,0 +1,1472 @@
+package nanomsg.async;%0A%0Aimport java.util.concurrent.ConcurrentLinkedQueue;%0Aimport java.util.concurrent.LinkedBlockingQueue;%0Aimport java.util.concurrent.atomic.AtomicBoolean;%0A%0Aimport java.util.Queue;%0Aimport java.util.LinkedList;%0Aimport java.lang.Thread;%0A%0Aimport nanomsg.async.IAsyncRunnable;%0Aimport nanomsg.exceptions.EAgainException;%0Aimport nanomsg.ISocket;%0A%0A%0Apublic class PollService implements Runnable %7B%0A    private final LinkedBlockingQueue%3CIAsyncRunnable%3E queue = new LinkedBlockingQueue%3CIAsyncRunnable%3E();%0A    private final AtomicBoolean started = new AtomicBoolean(false);%0A    public static final PollService service = new PollService();%0A%0A    public void registerOnce(final IAsyncRunnable handler) %7B%0A        /* Start scheduler if it not started */%0A        if (started.compareAndSet(false, true)) %7B%0A            final Thread t = new Thread(this, %22nanomsg-poll-scheduler%22);%0A            t.start();%0A        %7D%0A%0A        queue.offer(handler);%0A    %7D%0A%0A    @Override%0A    public String toString() %7B%0A        return %22pending=%22 + queue.size() + %22, thread started:%22 + started.get();%0A    %7D%0A%0A    public void run() %7B%0A        while (true) %7B%0A            try %7B%0A                final IAsyncRunnable handler = queue.take();%0A                try %7B%0A                    handler.run();%0A                %7D catch (EAgainException e) %7B%0A                    queue.offer(handler);%0A                %7D%0A            %7D catch (InterruptedException e) %7B%0A                break;%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

Add simple PollService.