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.
Fixes #2319
This PR reworks the events the executor sends to the frontend. I changed both, what events are send, how they are sent, the data the events contains, and how and in which order the events are processed by the frontend. The frontend now also keeps track of the overall progress of the chain instead of the backend like before.
Let's start with the backend changes:
chain-start
event. This event contains the list of nodes that will actually be executed. Due to caching and optimizations, this list is often different from the list of nodes the frontend sent to the backend. This list will be used for animations and progress by the frontend.__send_*
methods. This makes the code pretty clean.message
field in some responses of the backend API.Frontend changes:
animate
/unAnimate
methods like regular executions. They now have their own state to make sure these two systems don't interfere with each other.node-finish
might be run before anode-start
). This was the cause of the animation keeps playing #2319, and I fixed it by batching all node events together. I made the batch queue explicit and called it a backlog. It's necessary for the backlog to be explicit because we have to wait for all events to be fully processed before we can declare a run to be truly finished, or else some nasty race conditions occur.The backlog also has the advantage that we can process the whole queue at once instead of individual events, which allows for some nice optimizations when there are many events (e.g. a fast iterator).