##// END OF EJS Templates
container configuration docs
container configuration docs

File last commit:

r262:f1696cdc3d7a v3.0.8 v3
r276:b4e0f81c7425 v3
Show More
MockPollComponent.cs
36 lines | 1.1 KiB | text/x-csharp | CSharpLexer
cin
minor fixes
r260 using System;
using System.Threading;
using System.Threading.Tasks;
using Implab.Components;
namespace Implab.Test {
public class MockPollComponent : PollingComponent {
public Func<CancellationToken,Task> PollWorker { get; set;}
public Func<CancellationToken, Task> StartWorker { get; set; }
public Func<CancellationToken, Task> StopWorker { get; set; }
public MockPollComponent(bool initialized) : base(initialized) {
}
protected async override Task Poll(CancellationToken ct) {
if(PollWorker!= null)
await PollWorker.Invoke(ct);
}
protected async override Task StopInternalAsync(CancellationToken ct) {
cin
Added IInitializable.Initialize() overload...
r262 await base.StopInternalAsync(ct);
cin
minor fixes
r260 if (StopWorker != null)
await StopWorker.Invoke(ct);
}
protected async override Task StartInternalAsync(CancellationToken ct) {
cin
Added IInitializable.Initialize() overload...
r262 await base.StartInternalAsync(ct);
cin
minor fixes
r260 if (StartWorker != null)
await StartWorker.Invoke(ct);
}
}
}