diff Implab/Components/IRunnable.cs @ 208:7d07503621fe v2

RunnableComponent.Dispose(bool,Exception) changed to standart Dispose(bool) IRunnable is now disposable Code cleanups, suppressed some CodeAnalysis warnings
author cin
date Sun, 13 Nov 2016 18:28:17 +0300
parents 8200ab154c8a
children 9f63dade3a40
line wrap: on
line diff
--- a/Implab/Components/IRunnable.cs	Wed Nov 09 12:03:22 2016 +0300
+++ b/Implab/Components/IRunnable.cs	Sun Nov 13 18:28:17 2016 +0300
@@ -1,14 +1,22 @@
 using System;
 
 namespace Implab.Components {
-    public interface IRunnable {
+    /// <summary>
+    /// Interface for the component which performs a long running task.
+    /// </summary>
+    /// <remarks>
+    /// <para>The component also should implement <see cref="IDisposable"/> interface to be able to release used resources.</para>
+    /// <para>All methods of this interface must be a thread safe. If the operation is not applicable in the current state the
+    /// method should throw an exception and keep the current state unchanged.</para>
+    /// </remarks>
+    public interface IRunnable : IDisposable {
         /// <summary>
-        /// Starts this instance.
+        /// Starts this instance
         /// </summary>
         IPromise Start();
 
         /// <summary>
-        /// Stops this instance. After the instance is stopped it can't be started again, stopping should be treated as gracefull and async dispose.
+        /// Stops this instance, after the instance is stopped it can move to Failed, Ready or Disposed state, in case with the last it can't be reused.
         /// </summary>
         IPromise Stop();