From d169d22bfac5dbaad3e1f5485a85fa1240dd5b25 Mon Sep 17 00:00:00 2001 From: Yuchen Dai Date: Thu, 27 Feb 2020 03:14:53 +0000 Subject: [PATCH] doc: Event RunType Signed-off-by: Yuchen Dai http://www.wangafu.net/~nickm/libevent-book/Ref3_eventloop.html Pseudocode while (any events are registered with the loop, or EVLOOP_NO_EXIT_ON_EMPTY was set) { if (EVLOOP_NONBLOCK was set, or any events are already active) If any registered events have triggered, mark them active. else Wait until at least one event has triggered, and mark it active. ... } --- include/envoy/event/dispatcher.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/envoy/event/dispatcher.h b/include/envoy/event/dispatcher.h index 96bae513a4d4f..11e78c4f68958 100644 --- a/include/envoy/event/dispatcher.h +++ b/include/envoy/event/dispatcher.h @@ -186,8 +186,8 @@ class Dispatcher { * run() will return. */ enum class RunType { - Block, // Executes any events that have been activated, then exit. - NonBlock, // Waits for any pending events to activate, executes them, + Block, // Runs the event-loop until there are no pending events. + NonBlock, // Checks for any pending events to activate, executes them, // then exits. Exits immediately if there are no pending or // active events. RunUntilExit // Runs the event-loop until loopExit() is called, blocking