SyncthingCore.ManagedInstance.Watch C# (CSharp) Method

Watch() public method

Initiates the instance monitoring
public Watch ( ) : void
return void
        public void Watch()
        {
            // Check configuration
            if (PossibleEndpoints.Count == 0)
                throw new ManagedInstanceConfigurationException("No possible REST endpoints defined");

            if (string.IsNullOrWhiteSpace(ApiKey))
                throw new ManagedInstanceConfigurationException("No API key set");

            _fsm.Fire(Trigger.Watch);
        }

Usage Example

Example #1
0
        public async Task TestMissingEndpoints()
        {
            var instance = new ManagedInstance
            {
                ApiKey = "unittest"
            };

            instance.Watch();

            await Task.Delay(TimeSpan.FromSeconds(3));


            Assert.IsTrue(instance.IsInState(ManagedInstance.State.Disconnected));
        }
All Usage Examples Of SyncthingCore.ManagedInstance::Watch