Details
-
Improvement
-
Resolution: Fixed
-
Major
-
None
-
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
For Gerrit Dashboard: NCBC-1903 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
107137,3 | NCBC-1903: Refactor IOperation.Write to SendAsync | master | couchbase-net-client | Status: MERGED | +2 | +1 |