Skip to content

Deprecate IAsyncResult #27936

Closed
Closed

Description

@vanillajonathan

Consider marking the IAsyncResult interface and the AsyncResult class as obsolete and deprecate them in favor of the modern task-based asynchronous pattern.

Then in the future remove all APIs dependent on that interface. This would clean up the API substantially.

Activity

  1. omariom commented on Nov 16, 2018

    @omariom
    Contributor

    This would clean up the API substantially

    And break a lot of existing libraries.

  2. karelz commented on Nov 16, 2018

    @karelz
    Member
  3. vanillajonathan commented on Nov 16, 2018

    @vanillajonathan
    ContributorAuthor

    And break a lot of existing libraries.

    They could target an old version of the .NET Standard.

    We could consider soft deprecation: https://github.com/dotnet/platform-compat

    Yes, or even an option to hide them from IntelliSense and the online API documentation.

  4. Sebazzz commented on Nov 21, 2018

    @Sebazzz

    They could target an old version of the .NET Standard.

    .NET Standard will not removed APIs, only add them.

  5. vanillajonathan commented on Dec 3, 2018

    @vanillajonathan
    ContributorAuthor

    Could also be hidden using the EditorBrowsableState.Never attribute.

  6. transferred this issue fromdotnet/corefxon Jan 31, 2020
  7. added this to the Future milestone on Jan 31, 2020
  8. added
    untriaged
    on Feb 23, 2020
  9. removed
    untriaged
    on Jul 2, 2020
  10. miloush commented on Aug 15, 2020

    @miloush
    Contributor

    I understand that some APIs need to be obsoleted because they are fundamentally broken, unsecure or not working. I can also accept that an API can lead to so bad and widespread practices, that the benefits of reducing its usage outweigh compatibility.

    I don't see how IAsyncResult meets this bar though. Both are valid and working patterns. Obsoletion should not be taken lightly and using it to prefer one pattern over another seems inappropriate. Pattern preference is driven by many factors - subjective opinion, conventions, compatibility requirements - and changes over time.

  11. jeffhandley commented on Aug 1, 2021

    @jeffhandley
    Member

    Based on the types of APIs we've been marking as [Obsolete] since introducing "better obsoletion," I agree with @miloush that IAsyncResult does not meet the bar for obsoletion. It would be very disruptive without enough benefit to justify the disruption.

  12. ghost locked as resolved and limited conversation to collaborators on Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Runtimeenhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions