##// END OF EJS Templates
Merged in propose cancellations (pull request #1)...
Merged in propose cancellations (pull request #1) Propose cancellations Approved-by: m407 <bitbucket@m407.ru>

File last commit:

r13:745612edbd74 propose cancellat...
r21:dd8f8dfcd934 merge default
Show More
AsyncComponent.ts
16 lines | 531 B | video/mp2t | TypeScriptLexer
import { Cancellation } from "../Cancellation";
import { IAsyncComponent, ICancellation } from "../interfaces";
export class AsyncComponent implements IAsyncComponent {
_completion: Promise<void> = Promise.resolve();
getCompletion() { return this._completion };
runOperation(op: (ct: ICancellation) => any, ct: ICancellation = Cancellation.none) {
// TODO create cancellation source here
async function guard() {
await op(ct);
}
return this._completion = guard();
}
}