1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package io.netty.util.concurrent;
17
18 import java.util.concurrent.ThreadFactory;
19
20
21
22
23
24
25 final class DefaultEventExecutor extends SingleThreadEventExecutor {
26
27 DefaultEventExecutor(DefaultEventExecutorGroup parent, ThreadFactory threadFactory) {
28 super(parent, threadFactory, true);
29 }
30
31 DefaultEventExecutor(DefaultEventExecutorGroup parent, ThreadFactory threadFactory, int maxPendingTasks,
32 RejectedExecutionHandler rejectedExecutionHandler) {
33 super(parent, threadFactory, true, maxPendingTasks, rejectedExecutionHandler);
34 }
35
36 @Override
37 protected void run() {
38 for (;;) {
39 Runnable task = takeTask();
40 if (task != null) {
41 task.run();
42 updateLastExecutionTime();
43 }
44
45 if (confirmShutdown()) {
46 break;
47 }
48 }
49 }
50 }