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

Refactor IOperation.Write to IOperation.SendAsync

    XMLWordPrintable

Details

    • 1

    Description

      Returning a byte array from Write limits our options for memory management. We could refactor to an IMemoryOwner<byte>, but that puts the onus on the caller to handle disposing.

      On the other hand, if we refactor "byte[] Write()" to "Task SendAsync(IConnection connection), this makes the interface simpler. Any kind of memory (byte array or ReadOnlyMemory<byte>) can be passed on to IConnection, without changing memory ownership. Additionally, the caller is no longer required to pass in op.Completed as a parameter to IConnection.SendAsync, the operation can provide this itself, which creates a cleaner API.

      Attachments

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

        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