##// END OF EJS Templates
pool refactoring
pool refactoring

File last commit:

r109:1b7ebcc52e5a v2
r117:8beee0d11de6 v2
Show More
Extensions.cs
43 lines | 1.7 KiB | text/x-csharp | CSharpLexer
cin
rewritten tracing
r92 namespace Implab.Diagnostics {
public static class Extensions {
public static IPromise<T> EndLogicalOperation<T>(this IPromise<T> promise) {
Safe.ArgumentNotNull(promise, "promise");
var op = TraceContext.Instance.DetachLogicalOperation();
cin
minor fixes
r109 return promise.Then<T>(
x => {
TraceContext.Instance.EnterLogicalOperation(op,true);
TraceLog.TraceInformation("promise = {0}", x);
TraceLog.EndLogicalOperation();
TraceContext.Instance.Leave();
return x;
},
err =>{
TraceContext.Instance.EnterLogicalOperation(op,true);
TraceLog.TraceError("promise died {0}", err);
TraceLog.EndLogicalOperation();
TraceContext.Instance.Leave();
throw new TransientPromiseException(err);
},
() => {
TraceContext.Instance.EnterLogicalOperation(op,true);
TraceLog.TraceInformation("promise cancelled");
TraceLog.EndLogicalOperation();
TraceContext.Instance.Leave();
}
);
cin
rewritten tracing
r92 }
cin
minor fixes
r94
public static IPromise EndLogicalOperation(this IPromise promise) {
Safe.ArgumentNotNull(promise, "promise");
var op = TraceContext.Instance.DetachLogicalOperation();
return promise.Anyway(() => {
TraceContext.Instance.EnterLogicalOperation(op,true);
TraceLog.EndLogicalOperation();
TraceContext.Instance.Leave();
});
}
cin
rewritten tracing
r92 }
}