##// END OF EJS Templates
Added ResetState to RunnableComponent to reset in case of failure...
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

File last commit:

r151:ec91a6dfa5b3 v2
r205:8200ab154c8a v2
Show More
PromiseAwaiter.cs
28 lines | 636 B | text/x-csharp | CSharpLexer
using System;
using System.Runtime.CompilerServices;
namespace Implab {
public struct PromiseAwaiter : INotifyCompletion {
readonly IPromise m_promise;
public PromiseAwaiter(IPromise promise) {
m_promise = promise;
}
public void OnCompleted (Action continuation) {
if (m_promise != null)
m_promise.On(continuation, PromiseEventType.All);
}
public void GetResult() {
m_promise.Join();
}
public bool IsCompleted {
get {
return m_promise.IsResolved;
}
}
}
}