IRunnable.cs
29 lines
| 806 B
| text/x-csharp
|
CSharpLexer
cin
|
r152 | using System; | ||
cin
|
r250 | using System.Threading; | ||
using System.Threading.Tasks; | ||||
cin
|
r152 | |||
namespace Implab.Components { | ||||
cin
|
r250 | /// <summary> | ||
/// Interface for the component which performs a long running task. | ||||
cin
|
r208 | /// </summary> | ||
public interface IRunnable : IDisposable { | ||||
cin
|
r203 | /// <summary> | ||
cin
|
r208 | /// Starts this instance | ||
cin
|
r203 | /// </summary> | ||
cin
|
r250 | void Start(CancellationToken ct); | ||
cin
|
r152 | |||
cin
|
r203 | /// <summary> | ||
cin
|
r250 | /// Stops this instance and releases all resources, after the instance is stopped it is moved to Disposed state and can't be reused. | ||
cin
|
r203 | /// </summary> | ||
cin
|
r250 | void Stop(CancellationToken ct); | ||
Task<ExecutionState> Completion { get; } | ||||
cin
|
r152 | |||
ExecutionState State { get; } | ||||
cin
|
r205 | event EventHandler<StateChangeEventArgs> StateChanged; | ||
cin
|
r152 | Exception LastError { get; } | ||
} | ||||
} | ||||