Mercurial > pub > ImplabNet
annotate Implab/Components/IInitializable.cs @ 209:a867536c68fc v2
Bound promise to CancellationToken
Added new states to ExecutionSate enum.
Added Safe.Guard() method to handle cleanup of the result of the promise
| author | cin |
|---|---|
| date | Wed, 16 Nov 2016 03:06:08 +0300 |
| parents | 8200ab154c8a |
| children | 9f63dade3a40 |
| rev | line source |
|---|---|
| 152 | 1 using System; |
| 2 | |
| 3 namespace Implab.Components { | |
| 4 /// <summary> | |
| 5 /// Initializable components are created and initialized in two steps, first we have create the component, | |
|
205
8200ab154c8a
Added ResetState to RunnableComponent to reset in case of failure
cin
parents:
184
diff
changeset
|
6 /// then we have to complete it's creation by calling an <see cref="Initialize()"/> method. All parameters needed |
|
8200ab154c8a
Added ResetState to RunnableComponent to reset in case of failure
cin
parents:
184
diff
changeset
|
7 /// to complete the initialization must be passed before the calling <see cref="Initialize()"/> |
| 152 | 8 /// </summary> |
| 9 public interface IInitializable { | |
| 10 /// <summary> | |
| 11 /// Completes initialization. | |
| 12 /// </summary> | |
| 13 /// <remarks> | |
| 184 | 14 /// Normally virtual methods shouldn't be called from the constructor, due to the incomplete object state, but |
|
205
8200ab154c8a
Added ResetState to RunnableComponent to reset in case of failure
cin
parents:
184
diff
changeset
|
15 /// they can be called from this method. This method is aьуерщlso usefull when we constructing a complex grpah |
| 152 | 16 /// of components where cyclic references may take place. |
| 17 /// </remarks> | |
|
205
8200ab154c8a
Added ResetState to RunnableComponent to reset in case of failure
cin
parents:
184
diff
changeset
|
18 void Initialize(); |
| 152 | 19 } |
| 20 } | |
| 21 |
