diff --git a/src/Unosquare.Swan.Lite/Abstractions/IWorker.cs b/src/Unosquare.Swan.Lite/Abstractions/IWorker.cs new file mode 100644 index 000000000..8111425a5 --- /dev/null +++ b/src/Unosquare.Swan.Lite/Abstractions/IWorker.cs @@ -0,0 +1,18 @@ +namespace Unosquare.Swan.Abstractions +{ + /// + /// A simple interface for application workers + /// + public interface IWorker + { + /// + /// Should start the task immediately and asynchronously + /// + void Start(); + + /// + /// Should stop the task immediately and synchronously + /// + void Stop(); + } +} diff --git a/src/Unosquare.Swan/Abstractions/AppWorkerBase.cs b/src/Unosquare.Swan/Abstractions/AppWorkerBase.cs index 7acde04d0..12af8bb96 100644 --- a/src/Unosquare.Swan/Abstractions/AppWorkerBase.cs +++ b/src/Unosquare.Swan/Abstractions/AppWorkerBase.cs @@ -7,7 +7,8 @@ /// /// A base implementation of an Application service containing a worker task that performs background processing. /// - public abstract class AppWorkerBase + public abstract class AppWorkerBase + : IWorker { #region Property Backing