[Server] Complete IAsyncNodeManager Interface with support for sync Calls using SyncNodeManagerAdapter#3218
Conversation
…AsyncNodeManager Refactor MasterNodeManager to allow access to IAsyncNodeManager from NodeManagers & NamespaceManagers Properties
…stead of ref globalIdCounter
…eManagerMIMethods
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3218 +/- ##
==========================================
- Coverage 57.62% 57.60% -0.02%
==========================================
Files 355 356 +1
Lines 78679 78775 +96
Branches 13857 13867 +10
==========================================
+ Hits 45335 45378 +43
- Misses 29092 29150 +58
+ Partials 4252 4247 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR implements comprehensive support for asynchronous node managers in the OPC UA Server library using the Task Asynchronous Pattern (TAP). The changes enable servers to support both synchronous and asynchronous node managers side-by-side while maintaining backward compatibility.
Key changes:
- Added
IAsyncNodeManagerinterface withSyncNodeManagerproperty for compatibility - Introduced
IAsyncNodeManagerFactoryinterface for creating async node managers - Implemented
SyncNodeManagerAdapterto wrap async node managers for sync operations - Updated
MasterNodeManagerto handle both sync and async node managers uniformly
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Libraries/Opc.Ua.Server/NodeManager/INodeManager.cs | Added IAsyncNodeManagerFactory interface and SyncNodeManager property to IAsyncNodeManager |
| Libraries/Opc.Ua.Server/NodeManager/Adapters/SyncNodeManagerAdapter.cs | New adapter class to make async node managers compatible with sync interfaces |
| Libraries/Opc.Ua.Server/NodeManager/Adapters/AsyncNodeManagerAdapter.cs | Updated to implement IDisposable and use SyncNodeManager property |
| Libraries/Opc.Ua.Server/NodeManager/MasterNodeManager.cs | Major refactoring to support both sync and async node managers uniformly |
| Libraries/Opc.Ua.Server/Server/StandardServer.cs | Added support for registering async node manager factories |
| Tests/Opc.Ua.Server.Tests/MasterNodeManagerTests.cs | Updated tests to use new SyncNodeManager property |
| README.md | Added documentation for new async server support |
| Docs/AsyncServerSupport.md | New documentation explaining TAP support implementation |
| Applications/Quickstarts.Servers/ReferenceServer/ReferenceServer.cs | Updated to support async node manager factories |
| Libraries/Opc.Ua.Server/Opc.Ua.Server.csproj | Minor formatting fix |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Proposed changes
Add a SyncNodeManagerAdapter class.
Add a SyncNodeManager property to IAsyncNodeManager interface
Add IAsyncNodeManagerFactory interface
Allow to register IAsyncNodeManagers to the Server using
AddNodeManagerandRemoveNodeManagermethods.Allow to register IAsyncNodeManagers as NamespaceManagers using
MasterNodeManager.RegisterNamespaceManagerRelated Issues
Types of changes
Checklist