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

Consolidate SynchronizationContext usage of async in sync methods

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Won't Fix
    • Minor
    • backlog-2.0, .backlog
    • 2.3.9
    • None
    • None

    Description

      We need to protect the SynchronizationContext when executing and waiting on async methods from a synchronous methods, however there are three different implementations so far:

      1) Inline storing and overwriting the SynchronizationContext with a try / finally block
      2) Wrapping the task.Wait in a SynchronizationContextExclusion
      3) ConfigureAwait(false) or the extension method ContinueOnAnyContext

      Ideally we should have a single way to manage the SynchronizationContext. Our preference is option 3) ConfigureAwait(false) as this is the most concise and was designed to fulfil the requirement of not requiring the original context to be reloaded onto the thread.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            mike.goldsmith Michael Goldsmith
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty