Move socket connection interfaces to NATS.Client.Abstractions#1192
Conversation
Move INatsSocketConnection and INatsTlsUpgradeableSocketConnection to NATS.Client.Abstractions so custom transport implementers can depend on the contract without referencing Core, same rationale as the serialization interfaces already there. Both types are BCL-only. Keep the NATS.Client.Core namespace on the moved types and add TypeForwardedTo in Core to preserve source and binary compatibility. The obsolete ISocketConnection and INatsSocketConnectionFactory stay in Core; the factory takes NatsOpts so it cannot move without dragging Core options along. Add Microsoft.Bcl.AsyncInterfaces to the Abstractions netstandard2.0 group for IAsyncDisposable and ValueTask, which are not in that target's BCL.
|
Claude finished @mtmk's task in 2m 22s —— View job PR Review
Overall: The change is correct and well-structured. Follows the established pattern used for serialization interfaces. No bugs or security issues. What looks good
Notes / things to be aware of
Factory still requires Core: The goal stated in the PR description is "custom transport implementers can depend on the contract without referencing Core." That's true for the connection side — an implementation library only needs Abstractions. However, ABI test sends 7 bytes: No blocking issues. LGTM. |
Move the socket transport contracts INatsSocketConnection and INatsTlsUpgradeableSocketConnection to NATS.Client.Abstractions so custom transport implementers can depend on the contract without referencing Core, matching the serialization interfaces already there. The types keep the NATS.Client.Core namespace and are forwarded via TypeForwardedTo to preserve source and binary compatibility; the obsolete ISocketConnection and INatsSocketConnectionFactory stay in Core. The ABI compatibility harness is extended to cover both moved interfaces through a transient dependency compiled against an older release.
Fixes #1185