Skip to content

Conversation

BrennanConroy
Copy link
Member

Fixes #28241

@BrennanConroy BrennanConroy added the area-signalr Includes: SignalR clients and servers label Dec 29, 2020
@BrennanConroy BrennanConroy added this to the 6.0-preview1 milestone Dec 29, 2020
{
// cancellationToken is passed in by the user, and if they call cancel after the
// enumerator is finished but before the enumerator is disposed
// then _cts might already be disposed by our wrapping code
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should be throwing first-chance exceptions for a fairly common usage pattern. Can we combine MakeCancelableTypedAsyncEnumerable with CastIAsyncEnumerable in a way that ensures the registration is always disposed before CastIAsyncEnumerable disposes the CTS? The current layering makes it difficult, but if those were combined it should be easy enough.

We could also consider not disposing the CTS at all, but I'd prefer disposing it if it's straightforward enough.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went with the second option as fixing the layering will probably lead to a lot of duplicate code. And layering asyncenumerables on top of each other started annoying me 😆

Base automatically changed from master to main January 22, 2021 01:33
@BrennanConroy
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@BrennanConroy BrennanConroy merged commit 3cc4b95 into main Jan 22, 2021
@BrennanConroy BrennanConroy deleted the brecon/canceldispose branch January 22, 2021 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-signalr Includes: SignalR clients and servers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SignalR Stream is will throw when combined with ToObservable from IX.net, and the stream completes.

2 participants