-
Notifications
You must be signed in to change notification settings - Fork 323
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
Implement workflow-level Play button business-logic #6427
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -329,6 +329,21 @@ impl model::execution_context::API for ExecutionContext { | |
} | ||
.boxed_local() | ||
} | ||
|
||
fn start_execution(&self) -> BoxFuture<FallibleResult> { | ||
async move { | ||
self.language_server | ||
.client | ||
.recompute( | ||
&self.id, | ||
&language_server::InvalidatedExpressions::All, | ||
&Some(ExecutionEnvironment::Live), | ||
) | ||
.await?; | ||
Ok(()) | ||
} | ||
.boxed_local() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should also turn on "read-only" flag on controllers, implemented by @vitvakatu AFAIK. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That should already happen through the double click, which emits the appropriate FRP event from the graph editor. |
||
} | ||
} | ||
|
||
impl Drop for ExecutionContext { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -544,6 +544,7 @@ impl Project { | |
Event::Notification(Notification::ExecutionStatus(_)) => {} | ||
Event::Notification(Notification::ExecutionComplete { context_id }) => { | ||
execution_update_handler(context_id, ExecutionUpdate::Completed); | ||
publisher.notify(model::project::Notification::ExecutionFinished); | ||
Comment on lines
545
to
+547
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this notification is sent also when any execution finishes (also those performed automatically after a change), then we could have a race where:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch. But is the old execution not aborted when we request a new one? It could still happen in a very small time window, though. But I don't think we currently have a way to match a request for re-computation with its status update, unless I'm missing something. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @4e6 could you help us with that? Will the engine stop the current execution when receiving a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, when the |
||
} | ||
Event::Notification(Notification::ExpressionValuesComputed(_)) => { | ||
// the notification is superseded by `ExpressionUpdates`. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should add somewhere more information about this method. It's not just starting execution (as the execution is actually performed automatically on each change). According to the design. It ought to clear caches and re-execute the entire graph.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this handled by it using the
live
execution context? If not, we do need some more special handling here. I’ll have a look.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I clarified the naming and comments. The clean re-execution should be handled by the API call requesting
language_server::InvalidatedExpressions::All
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd call it something like
recompute_in_live_environment
to align with the underlying LS call. AFAIK this is not handled by thelive
environment specifically but rather by the usage ofrecompute
with specific arguments (InvalidatedExpressions::All
)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I chose
trigger_clean_live_execution
now, but we can dorecompute_in_live_environment
if that is preferable. I don't have a string opinion either way.