-
-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support sending async messages #376
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rationale: it should only be possible to interact with messages of known type
Also rename EventManager::push_boxed_msg -> push_erased_msg
…State::region_moved
futures-lite is already a dependency (of dark-light)
Also try_observe_msg -> try_observe These are shorter, and more in line with push variants (some of which are quite long enough without _msg).
Rationale: little perceived utility without UI updates, and for other uses there is no need to run through the toolkit.
Status:
|
Status: two bug fixes and some other tweaks. The animation is still broken on X11 but works on Wayland, so possibly a winit issue (more investigation needed). |
Status: fixed. Futures are now polled at the end of both event-processing and drawing operations (including futures pushed during this processing). This ensures futures using background threads or IO can start before the event loop sleeps. |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This renames
EventMgr::push_msg
topush
, and adds support for futures resolving to a message:The future is run on the same thread (thus should not have high CPU usage).
Currently, it is required to identify the sending widget (
id
) explicitly and the future is not polled immediately. This might change if theEventMgr
context tracks the current widget (WidgetId
).PR also includes changes to event handling. Most notably,
handle_message
may now be called on the widget which submitted the message (important for async rendering in Canvas using this async impl, but also useful for several other cases).The
Canvas
widget now uses async rendering. It is possible to observe that a resize initially scales the old result, then re-renders. I'd like to do the same forSvg
, butusvg::Tree
is neitherSend
norSync
so we can't push the work to another thread (without unsafe or other ugly workarounds).