Mercurial > pub > ImplabNet
comparison Implab/FuncTask.cs @ 149:eb793fbbe4ea v2
fixed promises cancellation
| author | cin |
|---|---|
| date | Wed, 06 May 2015 17:11:27 +0300 |
| parents | 8c0b95069066 |
| children | dd4a3590f9c6 |
comparison
equal
deleted
inserted
replaced
| 148:e6d4b41f0101 | 149:eb793fbbe4ea |
|---|---|
| 3 | 3 |
| 4 namespace Implab { | 4 namespace Implab { |
| 5 public class FuncTask<T> : FuncTaskBase<T>, IDeferred { | 5 public class FuncTask<T> : FuncTaskBase<T>, IDeferred { |
| 6 readonly Func<T> m_task; | 6 readonly Func<T> m_task; |
| 7 | 7 |
| 8 public FuncTask(Func<T> task, Func<Exception, T> error, Func<Exception, T> cancel) : base(error,cancel) { | 8 public FuncTask(Func<T> task, Func<Exception, T> error, Func<Exception, T> cancel, bool autoCancellable) : base(error, cancel, autoCancellable) { |
| 9 m_task = task; | 9 m_task = task; |
| 10 } | 10 } |
| 11 | 11 |
| 12 public void Resolve() { | 12 public void Resolve() { |
| 13 if (m_task != null && LockCancelation()) { | 13 if (m_task != null && LockCancelation()) { |
