annotate Implab/Components/IRunnable.cs @ 205:8200ab154c8a v2

Added ResetState to RunnableComponent to reset in case of failure Added StateChanged event to IRunnable Renamed Promise.SUCCESS -> Promise.Success Added Promise.FromException Renamed Bundle -> PromiseAll in PromiseExtensions
author cin
date Tue, 25 Oct 2016 17:40:33 +0300
parents 4d9830a9bbb8
children 7d07503621fe
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
152
240aa6994018 component model refactoring
cin
parents:
diff changeset
1 using System;
240aa6994018 component model refactoring
cin
parents:
diff changeset
2
240aa6994018 component model refactoring
cin
parents:
diff changeset
3 namespace Implab.Components {
240aa6994018 component model refactoring
cin
parents:
diff changeset
4 public interface IRunnable {
203
4d9830a9bbb8 Added 'Fail' method to RunnableComponent which allows component to move from
cin
parents: 152
diff changeset
5 /// <summary>
4d9830a9bbb8 Added 'Fail' method to RunnableComponent which allows component to move from
cin
parents: 152
diff changeset
6 /// Starts this instance.
4d9830a9bbb8 Added 'Fail' method to RunnableComponent which allows component to move from
cin
parents: 152
diff changeset
7 /// </summary>
152
240aa6994018 component model refactoring
cin
parents:
diff changeset
8 IPromise Start();
240aa6994018 component model refactoring
cin
parents:
diff changeset
9
203
4d9830a9bbb8 Added 'Fail' method to RunnableComponent which allows component to move from
cin
parents: 152
diff changeset
10 /// <summary>
4d9830a9bbb8 Added 'Fail' method to RunnableComponent which allows component to move from
cin
parents: 152
diff changeset
11 /// Stops this instance. After the instance is stopped it can't be started again, stopping should be treated as gracefull and async dispose.
4d9830a9bbb8 Added 'Fail' method to RunnableComponent which allows component to move from
cin
parents: 152
diff changeset
12 /// </summary>
152
240aa6994018 component model refactoring
cin
parents:
diff changeset
13 IPromise Stop();
240aa6994018 component model refactoring
cin
parents:
diff changeset
14
240aa6994018 component model refactoring
cin
parents:
diff changeset
15 ExecutionState State { get; }
240aa6994018 component model refactoring
cin
parents:
diff changeset
16
205
8200ab154c8a Added ResetState to RunnableComponent to reset in case of failure
cin
parents: 203
diff changeset
17 event EventHandler<StateChangeEventArgs> StateChanged;
8200ab154c8a Added ResetState to RunnableComponent to reset in case of failure
cin
parents: 203
diff changeset
18
152
240aa6994018 component model refactoring
cin
parents:
diff changeset
19 Exception LastError { get; }
240aa6994018 component model refactoring
cin
parents:
diff changeset
20 }
240aa6994018 component model refactoring
cin
parents:
diff changeset
21 }
240aa6994018 component model refactoring
cin
parents:
diff changeset
22