-
Notifications
You must be signed in to change notification settings - Fork 2
/
indexSuccess.ts
27 lines (26 loc) · 888 Bytes
/
indexSuccess.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import * as atomicOp from "./../../../req/operations/atomicOperations";
import {IndexFastaForBowTie2Alignment} from "../../../req/operations/indexFastaForBowTie2Alignment";
/**
* Resolves when indexFastaAlignment completes successfully, crashes the process
* with code 1 on failure
*
* @export
* @returns {Promise<void>}
*/
export async function indexSuccess() : Promise<void>
{
return new Promise<void>((resolve,reject) => {
atomicOp.updates.on("indexFastaForBowTie2Alignment",function(op : IndexFastaForBowTie2Alignment){
if(op.flags.done && op.flags.failure)
{
console.log("Failed to index");
return reject();
}
if(op.flags.done && op.flags.success)
{
console.log("succeeded indexing");
return resolve();
}
});
});
}