Snapshot: add parallelism
This commit is contained in:
parent
933725bbaf
commit
db2ea4242b
4 changed files with 190 additions and 131 deletions
|
@ -1,9 +1,11 @@
|
|||
"use strict";
|
||||
|
||||
const { app, BrowserWindow } = require("electron");
|
||||
let argDir = process.argv[2];
|
||||
let fs = require("fs");
|
||||
let cp = require("child_process");
|
||||
const fs = require("fs");
|
||||
const cp = require("child_process");
|
||||
|
||||
const argDir = process.argv[2];
|
||||
const taskFile = process.argv[3];
|
||||
|
||||
let mainWindow = null;
|
||||
let allWindowClosed = false;
|
||||
|
@ -43,6 +45,13 @@ const phases = {
|
|||
prepare: function (event, arg) {
|
||||
console.log(arg);
|
||||
GOTO(phases["receive-rect"]);
|
||||
|
||||
const tasks = JSON.parse(fs.readFileSync(taskFile));
|
||||
event.sender.send("start", tasks);
|
||||
},
|
||||
"wait-screenshot": function (event, arg) {
|
||||
console.log(arg);
|
||||
GOTO(phases["receive-rect"]);
|
||||
},
|
||||
"receive-rect": function (event, rect) {
|
||||
pendingTasks += 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue