-
Notifications
You must be signed in to change notification settings - Fork 1k
V2 subscription engine close gap for test and feature parity with classic engine #3824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 6 commits
c351234
c4783c1
febc55b
3872f97
43a33f1
b8945ac
7b91040
b3024db
cc7bb49
973aa82
dedf215
e7ad565
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,7 @@ | |
| * ======================================================================*/ | ||
|
|
||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Threading; | ||
| using System.Threading.Tasks; | ||
| using Opc.Ua.Client.Subscriptions.MonitoredItems; | ||
|
|
@@ -101,5 +102,61 @@ public interface ISubscription : IAsyncDisposable | |
| /// <param name="ct"></param> | ||
| ValueTask ConditionRefreshAsync( | ||
| CancellationToken ct = default); | ||
|
|
||
| /// <summary> | ||
| /// Configure triggering relationships between monitored items | ||
| /// in this subscription. The triggering item, when it reports | ||
| /// a notification, causes the linked triggered items to report | ||
| /// their next sampled value too — even when those triggered | ||
| /// items are in <see cref="MonitoringMode.Sampling"/> mode. | ||
| /// Per OPC UA Part 4 §5.13.5, the service call reports per-link | ||
| /// status; this implementation updates the local triggering | ||
| /// state on the V2 <see cref="IMonitoredItem"/>s | ||
| /// <see cref="IMonitoredItem.TriggeringItemClientHandle"/> / | ||
| /// <see cref="IMonitoredItem.TriggeredItemClientHandles"/> only | ||
| /// for links whose service result is Good. Partial failures do | ||
| /// not corrupt local state; callers inspect the returned | ||
| /// <see cref="SetTriggeringResponse"/> for per-link results. | ||
| /// </summary> | ||
| /// <param name="triggeringItemClientHandle"> | ||
| /// Client handle of the monitored item that owns the | ||
| /// triggering relationships.</param> | ||
| /// <param name="linksToAdd">Client handles of items to add as | ||
| /// triggered items. May be empty.</param> | ||
| /// <param name="linksToRemove">Client handles of items to | ||
| /// remove from the triggered set. May be empty.</param> | ||
| /// <param name="ct"></param> | ||
| /// <exception cref="ArgumentException">Raised when the | ||
| /// triggering item is not known to this subscription.</exception> | ||
| /// <exception cref="ServiceResultException">Raised when the | ||
| /// subscription has not been created on the server yet.</exception> | ||
| ValueTask<SetTriggeringResponse> SetTriggeringAsync( | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This API is too complicated to use. It should be via the IMonitoredItem items in some form, change the links between items, let the engine/manager apply the changed state.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Acknowledged - agree the API is too low-level. Not changed in this round; tracked as a separate follow-up plan to redesign as per-item LinkAsTriggeredBy(item) / UnlinkAsTriggeredBy(item) that the manager batches and applies via reconciliation. Needs its own design pass. |
||
| uint triggeringItemClientHandle, | ||
| IReadOnlyList<uint> linksToAdd, | ||
| IReadOnlyList<uint> linksToRemove, | ||
| CancellationToken ct = default); | ||
|
|
||
| /// <summary> | ||
| /// Mark this subscription as durable on the server (OPC UA Part 4 | ||
| /// §5.13.9 <c>SetSubscriptionDurable</c>). A durable subscription | ||
| /// retains its monitored item state and message queue across | ||
| /// session disconnects for the duration of the requested | ||
| /// lifetime, so a later | ||
| /// <see cref="ISubscriptionManager.RestoreAsync"/> with | ||
| /// <c>transferSubscriptions: true</c> can take over without | ||
| /// losing buffered notifications. | ||
| /// </summary> | ||
| /// <param name="lifetimeInHours">Requested lifetime, in hours. | ||
| /// The server may revise downwards.</param> | ||
| /// <param name="ct">Cancellation token.</param> | ||
| /// <returns>The server-revised lifetime, in hours.</returns> | ||
| /// <exception cref="ServiceResultException">Raised when the | ||
| /// subscription is not yet created on the server, or when the | ||
| /// server rejects the call (e.g. it has monitored items already | ||
| /// — per spec <c>SetSubscriptionDurable</c> must be called | ||
| /// before any items are added).</exception> | ||
| ValueTask<uint> SetSubscriptionDurableAsync( | ||
| uint lifetimeInHours, | ||
| CancellationToken ct = default); | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.