Skip to content

[Server] Complete IAsyncNodeManager Interface with support for sync Calls using SyncNodeManagerAdapter#3218

Merged
marcschier merged 35 commits into
OPCFoundation:masterfrom
romanett:AsyncNodeManagerOnly
Sep 23, 2025
Merged

[Server] Complete IAsyncNodeManager Interface with support for sync Calls using SyncNodeManagerAdapter#3218
marcschier merged 35 commits into
OPCFoundation:masterfrom
romanett:AsyncNodeManagerOnly

Conversation

@romanett

Copy link
Copy Markdown
Contributor

Proposed changes

Add a SyncNodeManagerAdapter class.
Add a SyncNodeManager property to IAsyncNodeManager interface
Add IAsyncNodeManagerFactory interface
Allow to register IAsyncNodeManagers to the Server using AddNodeManager and RemoveNodeManager methods.
Allow to register IAsyncNodeManagers as NamespaceManagers using MasterNodeManager.RegisterNamespaceManager

Related Issues

  • Fixes #

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which adds functionality)
  • Test enhancement (non-breaking change to increase test coverage)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected, requires version increase of Nuget packages)
  • Documentation Update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc.
  • I have signed the CLA.
  • I ran tests locally with my changes, all passed.
  • I fixed all failing tests in the CI pipelines.
  • I fixed all introduced issues with CodeQL and LGTM.
  • I have added tests that prove my fix is effective or that my feature works and increased code coverage.
  • I have added necessary documentation (if appropriate).
  • Any dependent changes have been merged and published in downstream modules.

@codecov

codecov Bot commented Sep 22, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 45.38153% with 136 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.60%. Comparing base (2902718) to head (a1c6c47).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
...ver/NodeManager/Adapters/SyncNodeManagerAdapter.cs 0.00% 55 Missing ⚠️
...ies/Opc.Ua.Server/NodeManager/MasterNodeManager.cs 62.69% 41 Missing and 6 partials ⚠️
...er/NodeManager/Adapters/AsyncNodeManagerAdapter.cs 51.72% 6 Missing and 22 partials ⚠️
Libraries/Opc.Ua.Server/Server/StandardServer.cs 40.00% 5 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread Docs/AsyncServerSupport.md Outdated
@romanett
romanett requested a review from mrsuciu September 22, 2025 13:11
@romanett
romanett marked this pull request as ready for review September 22, 2025 13:11
@romanett
romanett requested a review from Copilot September 22, 2025 13:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 IAsyncNodeManager interface with SyncNodeManager property for compatibility
  • Introduced IAsyncNodeManagerFactory interface for creating async node managers
  • Implemented SyncNodeManagerAdapter to wrap async node managers for sync operations
  • Updated MasterNodeManager to 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.

Comment thread Libraries/Opc.Ua.Server/NodeManager/Adapters/SyncNodeManagerAdapter.cs Outdated
Comment thread Docs/AsyncServerSupport.md Outdated
Comment thread Docs/AsyncServerSupport.md Outdated
@marcschier
marcschier merged commit 8053989 into OPCFoundation:master Sep 23, 2025
99 of 101 checks passed
@romanett
romanett deleted the AsyncNodeManagerOnly branch October 24, 2025 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants