GeezerVison is showing github.com — Auto-port 4.2: SingleThreadEventExecutor: document Throwable safety c… · netty/netty@71b61e9
File tree
Expand file treeCollapse file tree
Open diff view settings
common/src/main/java/io/netty/util/concurrent
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: common/src/main/java/io/netty/util/concurrent/SingleThreadEventExecutor.java +10-1Lines changed: 10 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -690,7 +690,16 @@ protected boolean isSuspensionSupported() { |
690 | 690 | } |
691 | 691 |
|
692 | 692 | /** |
693 | | - * Run the tasks in the {@link #taskQueue} |
| 693 | + * Runs the task-processing loop until {@link #confirmShutdown()} returns {@code true}. |
| 694 | + * |
| 695 | + * <p>Implementations <strong>must not let a {@link Throwable} thrown by a task escape this |
| 696 | + * method</strong>: any uncaught {@link Throwable} terminates the executor (logged at {@code WARN} |
| 697 | + * and surfaced via {@link #terminationFuture()}), at which point every {@code Channel} |
| 698 | + * registered with this executor stops processing I/O and new task submissions are rejected. |
| 699 | + * The supplied helpers - {@link #runAllTasks()}, {@link #runAllTasks(long)}, and |
| 700 | + * {@link #safeExecute(Runnable)} - catch {@code Throwable} for you; custom loops built on |
| 701 | + * {@link #pollTask()} or {@link #takeTask()} are responsible for wrapping each task |
| 702 | + * invocation accordingly. |
694 | 703 | */ |
695 | 704 | protected abstract void run(); |
696 | 705 |
|
|