Skip to content

Add handler for deferred execution of messages#2951

Merged
TrueDoctor merged 5 commits intomasterfrom
defer-handler
Jul 28, 2025
Merged

Add handler for deferred execution of messages#2951
TrueDoctor merged 5 commits intomasterfrom
defer-handler

Conversation

@TrueDoctor
Copy link
Copy Markdown
Member

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

@github-actions github-actions Bot temporarily deployed to graphite-dev (Preview) July 28, 2025 10:54 Inactive
@github-actions github-actions Bot temporarily deployed to graphite-dev (Preview) July 28, 2025 11:04 Inactive
@github-actions github-actions Bot temporarily deployed to graphite-dev (Preview) July 28, 2025 12:47 Inactive
@github-actions github-actions Bot temporarily deployed to graphite-dev (Preview) July 28, 2025 13:51 Inactive
},
})
}
// Some parts of the editior depend on these bounds to be present
Copy link
Copy Markdown
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.

Comment thread editor/src/messages/portfolio/document/document_message_handler.rs Outdated
DeferMessage::AfterGraphRun { mut messages } => {
self.after_graph_run.extend(messages.drain(..).map(|m| (self.current_graph_submission_id, m)));
}
DeferMessage::AfterViewportReady { messages } => {
Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread editor/src/messages/defer/defer_message_handler.rs
Comment thread editor/src/messages/defer/defer_message_handler.rs
@github-actions github-actions Bot temporarily deployed to graphite-dev (Preview) July 28, 2025 18:03 Inactive
@Keavon Keavon changed the title Add Handler for defered execution of messages Add handler for deferred execution of messages Jul 28, 2025
@github-actions github-actions Bot temporarily deployed to graphite-dev (Preview) July 28, 2025 23:26 Inactive
@github-actions github-actions Bot temporarily deployed to graphite-dev (Preview) July 28, 2025 23:48 Inactive
Comment thread editor/src/messages/tool/tool_messages/spline_tool.rs
@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