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
sourceIdstringA unique identifier for the subscription source (e.g., GUID).
onChangeAction<ElementStateChange>Action to be executed when a state change occurs.
subscribeTimeoutTimeSpanTime limit to establish the subscription.
Remarks
For use outside of Protocols. Use the SLProtocol-based version inside Protocols for proper subscription handling.
Exceptions
- ArgumentNullException
sourceIdoronChangeis 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
sourceIdstringUnique string that identifies the source of the subscription.
onChangeAction<ElementStateChange>Callback executed on every state change event.
Remarks
Intended for non-Protocol use only. For Protocols, use the overload with SLProtocol.
Exceptions
- ArgumentNullException
sourceIdoronChangeis null.- InvalidOperationException
Subscription could not be initialized in the default time frame.