-
Notifications
You must be signed in to change notification settings - Fork 563
Split value production events #406
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
Conversation
| case ReturnValueProduced returnValueProduced: | ||
| OnReturnValueProduced(returnValueProduced); | ||
| break; | ||
| case ValueUpdated valueUpdated: |
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.
Does this indicate a return value was updated or also a display data?
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.
return value maps to ExecuteReply, ma I answering your question?
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 ValueUpdated being used for both return values and values produced using display?
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.
display(x) produces a ValueProduced event, ValueUpdated is generated by calling the d.Update(x) method
|
|
||
| private void OnReturnValueProduced(ReturnValueProduced returnValueProduced) | ||
| { | ||
| var openRequest = InFlightRequests.Values.SingleOrDefault(); |
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've hit a bunch of bugs with this line that was copy-pasted. I changed it to TryGetValue in my PR.
| } | ||
| } | ||
|
|
||
| private void OnValueUpdated(ValueUpdated valueUpdated) |
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.
There's a lot of repeated code here. Maybe a base type for the various "value produced / updated" type events so they can go through the same method?
| { | ||
| public class ValueProduced : KernelEventBase | ||
| { | ||
| public ValueProduced( |
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.
Does this now correspond to display data?
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.
yes
|
|
||
| events.Should() | ||
| .ContainSingle(e => e is ValueProduced) | ||
| .ContainSingle(e => e is Events.DisplayedValue) |
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.
DisplayedValueProduced
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 will get there .. eventually
| namespace Microsoft.DotNet.Interactive.Events | ||
| { | ||
| public class ValueUpdated : ValueProductionEvent | ||
| public class ValueUpdated : ValueProducedEventBase |
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.
So is this more appropriately called DisplayedValueUpdated?
Emit different events to clarify the semantic
when code submission evaluates to a value -> ReturnValueProduced -> ExecuteReply
when a value is produced (via display or console redirection) -> DisplayedValueProduced-> DisplayData
when a value is updated (via Update api) -> DisplayedValueUpdated-> UpdateDisplayData