Skip to content

doc: Event RunType#10185

Merged
mattklein123 merged 1 commit intoenvoyproxy:masterfrom
lambdai:dispatchdoc
Mar 3, 2020
Merged

doc: Event RunType#10185
mattklein123 merged 1 commit intoenvoyproxy:masterfrom
lambdai:dispatchdoc

Conversation

@lambdai
Copy link
Contributor

@lambdai lambdai commented Feb 27, 2020

Signed-off-by: Yuchen Dai silentdai@gmail.com

Description:
See 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.

...
}

Risk Level: LOW
Testing:
Docs Changes:
Release Notes:

Signed-off-by: Yuchen Dai <silentdai@gmail.com>

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.
...
}
@mattklein123
Copy link
Member

Thanks for the contribution, but from an interface perspective we are mostly trying to the hide the libevent details and I think the existing text is probably fine? I'm not sure it's really worth updating.

@lambdai
Copy link
Contributor Author

lambdai commented Mar 2, 2020

Our code base is relying on the described behavior. See below.
Also original comment bite me when I am writing integration test.


      // Must create a keepalive timer to keep the dispatcher from exiting.
      std::chrono::milliseconds time_interval(500);
      keepalive_timer_ = dispatcher_->createTimer(...);
      dispatcher_->run(Dispatcher::RunType::Block);

@mattklein123 mattklein123 merged commit 5cc01d5 into envoyproxy:master Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants