Skip to content

handler: run event loop within executor#48279

Merged
jkarneges merged 1 commit intomainfrom
jkarneges/eventloop-with-executor
Oct 29, 2025
Merged

handler: run event loop within executor#48279
jkarneges merged 1 commit intomainfrom
jkarneges/eventloop-with-executor

Conversation

@jkarneges
Copy link
Member

@jkarneges jkarneges commented Oct 21, 2025

Now that the necessary APIs have been made available to the C++ code, we can run an EventLoop that executes asynchronously within a task spawned on an Executor. We'll start out by doing this in the handler.

Moving the existing straight-line logic into the setup and done closures is a little tricky regarding lifetimes. The closures borrow, so we need to make sure the loop, deferCall, and engine bindings all live outside them, and we need to ensure correct construction/destruction ordering. Notably, DeferCall must not be constructed until after an EventLoop exists (i.e. after setup called), and it needs to be destructed before the EventLoop goes away (i.e. before done ends).

@jkarneges jkarneges force-pushed the jkarneges/eventloop-with-executor branch from 4971d5e to 19549c3 Compare October 22, 2025 16:42
@jkarneges jkarneges force-pushed the jkarneges/eventloop-with-executor branch from 19549c3 to 407f647 Compare October 29, 2025 19:28
@jkarneges jkarneges marked this pull request as ready for review October 29, 2025 19:41
@jkarneges jkarneges requested a review from a team October 29, 2025 19:55
@jkarneges jkarneges merged commit 5f17410 into main Oct 29, 2025
19 checks passed
@jkarneges jkarneges deleted the jkarneges/eventloop-with-executor branch October 29, 2025 21:01
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