-
-
Notifications
You must be signed in to change notification settings - Fork 335
/
ITaskExecutor.cs
51 lines (45 loc) · 1.45 KB
/
ITaskExecutor.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System;
using System.Diagnostics.CodeAnalysis;
namespace GeneticSharp
{
/// <summary>
/// Defines a interface to a task executor.
/// </summary>
public interface ITaskExecutor
{
#region Properties
/// <summary>
/// Gets or sets the timeout to execute the tasks.
/// </summary>
TimeSpan Timeout { get; set; }
/// <summary>
/// Gets a value indicating whether this instance is running.
/// </summary>
/// <value>
/// <c>true</c> if this instance is running; otherwise, <c>false</c>.
/// </value>
bool IsRunning { get; }
#endregion
#region Methods
/// <summary>
/// Add the specified task to be executed.
/// </summary>
/// <param name="task">The task.</param>
void Add(Action task);
/// <summary>
/// Clear all the tasks.
/// </summary>
void Clear();
/// <summary>
/// Starts the tasks execution.
/// </summary>
/// <returns>If has reach the timeout false, otherwise true.</returns>
bool Start();
/// <summary>
/// Stops the tasks execution.
/// </summary>
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Stop", Justification = "there is no better name")]
void Stop();
#endregion
}
}