Method StartServiceStateMonitor
- Namespace
- Skyline.DataMiner.Core.DataMinerSystem.Common
- Assembly
- Skyline.DataMiner.Core.DataMinerSystem.Common.dll
StartServiceStateMonitor(string, Action<ServiceStateChange>, TimeSpan)
Starts monitoring service state changes. Every change triggers the specified onChange
action.
void StartServiceStateMonitor(string sourceId, Action<ServiceStateChange> onChange, TimeSpan subscribeTimeout)
Parameters
sourceId
stringA unique string identifying the source of the subscription.
onChange
Action<ServiceStateChange>Callback invoked when a service’s state changes.
subscribeTimeout
TimeSpanHow long to wait for the subscription to succeed.
Remarks
Use these methods outside of Protocols. In Protocols, use SLProtocol
-based versions.
Exceptions
- ArgumentNullException
sourceId
oronChange
is null.- InvalidOperationException
Could not establish the subscription within the timeout period.
StartServiceStateMonitor(string, Action<ServiceStateChange>)
Starts monitoring service state changes. Every change triggers the specified onChange
action.
void StartServiceStateMonitor(string sourceId, Action<ServiceStateChange> onChange)
Parameters
sourceId
stringA unique string identifying the source of the subscription.
onChange
Action<ServiceStateChange>Callback invoked when a service’s state changes.
Remarks
Use these methods outside of Protocols. In Protocols, use SLProtocol
-based versions.
Exceptions
- ArgumentNullException
sourceId
oronChange
is null.- InvalidOperationException
Could not establish the subscription within the timeout period.