Skip to content

[Feature]: Support DisposeManyAsync #990

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

Open
Dunge opened this issue Mar 12, 2025 · 2 comments
Open

[Feature]: Support DisposeManyAsync #990

Dunge opened this issue Mar 12, 2025 · 2 comments

Comments

@Dunge
Copy link

Dunge commented Mar 12, 2025

Describe the functionality desired 🐞

Reopening #404 since it was closed and not completed and is still relevant.

I have a connected ObservableCollection that the objects would require to implement IAsyncDisposable.
I managed to get it working y wrapping it in a Task.Run() inside the normal Dispose, but that doesn't seem safe.

Sorry I don't have a PR to provide, just opening a ticket so that it remains in the known list of stuff to do.

The steps the functionality will provide

?

Considerations

?

@JakenVeina
Copy link
Collaborator

JakenVeina commented Mar 13, 2025

IAsyncDisposable is pretty darn niche, but I see no reason not to support it, if we support IDisposable.

I will say the operator name should, I think, be AsyncDisposeMany(), or even DisposeAsyncMany(). Async() as a method suffix should be reserved exclusively for awaitable methods.

@Dunge
Copy link
Author

Dunge commented Mar 13, 2025

Agreed for the name.

My use case if interested : I use DynamicData in a Blazor application to obtain a filtered/transformed derived collection based on another. The elements represents polylines on a google map component. Everything to interact with it is done via javascript interops, which are async calls. When an element gets removed from the collection, I need to do one and the dispose methods seems to be the correct place for that.

This lead me to another similar issue on creation. It would also be interesting to have the capabilities for an async Initialiser method since constructors can't be. I'm once again required to launch a task unawaited.. But this is not the scope of this ticket.

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

No branches or pull requests

2 participants