comparison Implab/IPromise.cs @ 151:ec91a6dfa5b3 v2

Added support for 'await' operator to promises
author cin
date Thu, 04 Feb 2016 02:43:05 +0300
parents 8c0b95069066
children cbe10ac0731e
comparison
equal deleted inserted replaced
150:3258399cba83 151:ec91a6dfa5b3
23 23
24 /// <summary> 24 /// <summary>
25 /// Исключение возникшее в результате выполнения обещания, либо причина отмены. 25 /// Исключение возникшее в результате выполнения обещания, либо причина отмены.
26 /// </summary> 26 /// </summary>
27 Exception Error { get; } 27 Exception Error { get; }
28
29 /// <summary>
30 /// Creates a new promise dependend on the current one and resolved on
31 /// executing the specified handlers.
32 /// </summary>
33 /// <param name="success">The handler called on the successful promise completion.</param>
34 /// <param name="error">The handler is called if an error while completing the promise occurred.</param>
35 /// <param name="cancel">The handler is called in case of promise cancellation.</param>
36 /// <returns>The newly created dependant promise.</returns>
37 /// <remarks>
38 /// <para>
39 /// If the success handler is specified the dependend promise will be resolved after the handler is
40 /// executed and the dependent promise will be linked to the current one, i.e. the cancellation
41 /// of the dependent property will lead to the cancellation of the current promise. If the
42 /// success handler isn't specified the dependent promise will not be linked to and
43 /// will not be resolved after the successfull resolution of the current one.
44 /// </para>
45 /// <para>
46 /// When the error handler is specified, the exception raised during the current promise completion
47 /// will be passed to it as the parameter. If the error handler returns without raising an
48 /// exception then the dependant promise will be resolved successfully, otherwise the exception
49 /// raised by the handler will be transmitted to the dependent promise. If the handler wants
50 /// to passthrough the original exception it needs to wrap the exception with
51 /// the <see cref="PromiseTransientException"/>. The handler may raise <see cref="OperationCanceledException"/>
52 /// to cancel the dependant promise, the innner exception specifies the reason why the promise
53 /// is canceled.
54 /// </para>
55 /// <para>
56 /// If the cancelation handler is specified and the current promise is cancelled then the dependent
57 /// promise will be resolved after the handler is executed. If the cancelation handler raises the
58 /// exception it will be passed to the dependent promise.
59 /// </para>
60 /// </remarks>
61 /* IPromise Then(Action success, Action<Exception> error, Action<Exception> cancel);
62 IPromise Then(Action success, Action<Exception> error);
63 IPromise Then(Action success);
64
65 IPromise Chain(Func<IPromise> chained, Func<Exception, IPromise> error, Func<Exception, IPromise> cancel);
66 IPromise Chain(Func<IPromise> chained, Func<Exception, IPromise> error);
67 IPromise Chain(Func<IPromise> chained);*/
68 28
69 /// <summary> 29 /// <summary>
70 /// Adds specified listeners to the current promise. 30 /// Adds specified listeners to the current promise.
71 /// </summary> 31 /// </summary>
72 /// <param name="success">The handler called on the successful promise completion.</param> 32 /// <param name="success">The handler called on the successful promise completion.</param>