Skip to content
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

KernelCommandResult.KernelEvents type change #2699

Merged
merged 5 commits into from
Feb 8, 2023

Conversation

jonsequitur
Copy link
Contributor

@jonsequitur jonsequitur commented Feb 8, 2023

On the way to improving diagnostics, we decided to change KernelCommandResult.KernelEvents from IObservable<KernelEvent> to IReadOnlyList<KernelEvent>, since this fits the common usage pattern much more closely.

In practice, the observable returned by KernelCommandResult.KernelEvents is always fully populated by the time the CommandResult is returned from SendAsync. Certain internal methods respond to the emitted events as they're produced but the external user of the API will never see them until the sequence is completed, which is why it was implemeted as a ReplaySubject.

This change should make the API clearer and easier to use.

@jonsequitur jonsequitur changed the title Diagnostic improvements, KernelCommandResult.KernelEvents type change KernelCommandResult.KernelEvents type change Feb 8, 2023
@jonsequitur jonsequitur marked this pull request as ready for review February 8, 2023 21:27
@colombod colombod enabled auto-merge (rebase) February 8, 2023 21:48
@colombod colombod merged commit 1e8f5b0 into dotnet:main Feb 8, 2023
@shyamnamboodiripad
Copy link
Contributor

@jonsequitur This change ended up breaking the workbench prototype. Not a significant issue and the fix was obviously simple (and a definite improvement considering that KernelEvents was always populated before SendAsync returns a CommandResult). But as we have been discussing, I think it would be great if we can front load as many such API changes as possible before we start consuming the API in more places :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants