public void execute(Runnable command) { // TODO: What todo if the add return false ? tasks.add(command); if (!isRunning.get()) { doUnorderedExecute(this); } }
/** * Executes the specified task concurrently while maintaining the event * order. */ @Override protected void doExecute(Runnable task) { if (!(task instanceof ChannelEventRunnable)) { doUnorderedExecute(task); } else { ChannelEventRunnable r = (ChannelEventRunnable) task; getChildExecutor(r.getEvent()).execute(task); } }