Skip to content

Add handler for deferred execution of messages #2951

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

Merged
merged 5 commits into from
Jul 28, 2025
Merged

Conversation

TrueDoctor
Copy link
Member

This avoids blocking all message processing until a graph execution has been completed

@@ -1435,6 +1435,20 @@ impl MessageHandler<DocumentMessage, DocumentMessageContext<'_>> for DocumentMes
},
})
}
// Some parts of the editior depend on these bounds to be present
Copy link
Collaborator

@adamgerhant adamgerhant Jul 28, 2025

Choose a reason for hiding this comment

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

what parts? (answer: zooming to fill bounds) Ideally the editor should not be aware of the bounds at all, since it treats the top left corner of the vieport at (0,0). Only the executor should know the bounds in order to evaluate the node graph.

DeferMessage::AfterGraphRun { mut messages } => {
self.after_graph_run.extend(messages.drain(..).map(|m| (self.current_graph_submission_id, m)));
}
DeferMessage::AfterViewportReady { messages } => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

It should not be possible to add messages to this buffer if there are currently bounds. An if statement in here would be a good prevention.

Copy link
Member Author

Choose a reason for hiding this comment

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

That is not the responsibility of this message handler and would violate architectural separation. And it is possible to use this callback even if bounds are present and the code still works

@Keavon Keavon changed the title Add Handler for defered execution of messages Add handler for deferred execution of messages Jul 28, 2025
@TrueDoctor TrueDoctor merged commit 35ab266 into master Jul 28, 2025
4 checks passed
@TrueDoctor TrueDoctor deleted the defer-handler branch July 28, 2025 23:57
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.

3 participants