feat(otopcua): add ITagDiscovery.RediscoverPolicy + per-driver assignments (follow-up B)

This commit is contained in:
Joseph Doherty
2026-06-26 12:18:44 -04:00
parent c2c368dcec
commit a378b572af
7 changed files with 66 additions and 0 deletions
@@ -1,5 +1,17 @@
namespace ZB.MOM.WW.OtOpcUa.Core.Abstractions;
/// <summary>How aggressively the host re-runs post-connect discovery for this driver.</summary>
public enum DiscoveryRediscoverPolicy
{
/// <summary>Retry every interval up to the cap or until the captured set is non-empty and stable
/// (for drivers whose discovered shape fills in asynchronously after connect, e.g. the FOCAS FixedTree).</summary>
UntilStable,
/// <summary>Run exactly one discovery pass on connect (drivers that discover synchronously in DiscoverAsync).</summary>
Once,
/// <summary>Never run post-connect discovery.</summary>
Never,
}
/// <summary>
/// Driver capability for discovering tags and hierarchy from the backend.
/// Streams discovered nodes into <see cref="IAddressSpaceBuilder"/> rather than
@@ -14,4 +26,7 @@ public interface ITagDiscovery
/// <param name="builder">The address space builder to stream discovered nodes into.</param>
/// <param name="cancellationToken">A cancellation token for the discovery operation.</param>
Task DiscoverAsync(IAddressSpaceBuilder builder, CancellationToken cancellationToken);
/// <summary>Post-connect re-discovery policy. Default preserves the original retry-until-stable behavior.</summary>
DiscoveryRediscoverPolicy RediscoverPolicy => DiscoveryRediscoverPolicy.UntilStable;
}