Method StartStateMonitor
- Namespace
- Skyline.DataMiner.Core.DataMinerSystem.Common
- Assembly
- Skyline.DataMiner.Core.DataMinerSystem.Common.dll
StartStateMonitor(string, Action<ElementStateChange>, TimeSpan)
Starts monitoring state changes for a specific element. Every change triggers the specified onChange
action.
void StartStateMonitor(string sourceId, Action<ElementStateChange> onChange, TimeSpan subscribeTimeout)
Parameters
sourceId
stringA unique identifier for the subscription source (e.g., GUID).
onChange
Action<ElementStateChange>Action to be executed when a state change occurs.
subscribeTimeout
TimeSpanTime limit to establish the subscription.
Remarks
For use outside of Protocols. Use the SLProtocol
-based version inside Protocols for proper subscription handling.
Exceptions
- ArgumentNullException
sourceId
oronChange
is null.- InvalidOperationException
Subscription setup failed within the specified timeout.
StartStateMonitor(string, Action<ElementStateChange>)
Starts monitoring element state changes using the default timeout.
void StartStateMonitor(string sourceId, Action<ElementStateChange> onChange)
Parameters
sourceId
stringUnique string that identifies the source of the subscription.
onChange
Action<ElementStateChange>Callback executed on every state change event.
Remarks
Intended for non-Protocol use only. For Protocols, use the overload with SLProtocol
.
Exceptions
- ArgumentNullException
sourceId
oronChange
is null.- InvalidOperationException
Subscription could not be initialized in the default time frame.