Class AbstractOioWorker<C extends AbstractOioChannel>

    • Field Detail

      • eventQueue

        private final java.util.Queue<java.lang.Runnable> eventQueue
      • thread

        protected volatile java.lang.Thread thread
        If this worker has been started thread will be a reference to the thread used when starting. i.e. the current thread when the run method is executed.
      • done

        private volatile boolean done
    • Constructor Detail

      • AbstractOioWorker

        protected AbstractOioWorker​(C channel)
    • Method Detail

      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
      • executeInIoThread

        public void executeInIoThread​(java.lang.Runnable task)
        Description copied from interface: Worker
        Execute the given Runnable in the IO-Thread. This may be now or later once the IO-Thread do some other work.
        Specified by:
        executeInIoThread in interface Worker
        Parameters:
        task - the Runnable to execute
      • processEventQueue

        private void processEventQueue()
      • process

        abstract boolean process()
                          throws java.io.IOException
        Process the incoming messages and also is responsible for call Channels.fireMessageReceived(Channel, Object) once a message was processed without errors.
        Returns:
        continue returns true as long as this worker should continue to try processing incoming messages
        Throws:
        java.io.IOException