Skip to content
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

Simplify the implementation of the message buffering #2123

Merged
merged 2 commits into from
Dec 2, 2024

Conversation

0HyperCube
Copy link
Member

This is an attempt to slightly simplify the logic of the message buffering, whilst also fixing the debug message tree during buffering such that the message parents are properly aligned.

Also improved was the functionality when attempting to run another message when a buffer is open. Instead of this new message being processed first, it is processed last.

sample message tree

Copy link
Collaborator

@adamgerhant adamgerhant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, I tested it with offset transforms and everything still works.

In general I'm still a bit uncertain if the message buffering is the correct solution to "async" messages that can only be run once a "promise" is resolved. There essentially needs to be a way for the message to be queued and executed once some data is available after some number of renders. Currently this is necessary for layers to await until their transform has been computed and returned, but in the future a more flexible system might be necessary where for instance a message can be queued for a certain number of milliseconds or until some state changes in the network, which may take multiple renders

editor/src/dispatcher.rs Show resolved Hide resolved
@0HyperCube 0HyperCube force-pushed the simplify-message-buffering branch from fc99c26 to dbc4807 Compare December 2, 2024 20:33
@0HyperCube 0HyperCube merged commit b21b1cb into master Dec 2, 2024
4 checks passed
@0HyperCube 0HyperCube deleted the simplify-message-buffering branch December 2, 2024 20:48
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