Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-3097

Use TaskCreationOptions.RunContinuationsAsynchronously

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Minor
    • 3.2.7
    • 3.2.6
    • None
    • None
    • 1

    Description

      Per https://github.com/davidfowl/AspNetCoreDiagnosticScenarios/blob/master/AsyncGuidance.md#always-create-taskcompletionsourcet-with-taskcreationoptionsruncontinuationsasynchronously, it's best to create TaskCompletionSource<T> with the option TaskCreationOptions.RunContinuationsAsynchronously in most cases. This causes any awaits waiting on the task to have the continuation queued to another thread.

      While this is a slight perf hit in many cases, we only use TaskCompletionSource to cover some corners around ConnectionPool scale down. The improved safety of RunContinuationsAsynchronously is preferable.

      Attachments

        For Gerrit Dashboard: NCBC-3097
        # Subject Branch Project Status CR V

        Activity

          People

            btburnett3 Brant Burnett
            btburnett3 Brant Burnett
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty