mirror of
https://github.com/gchq/CyberChef
synced 2025-01-23 09:45:02 +00:00
Use transferable objects to send arraybuffers back to the workerwaiter
This commit is contained in:
parent
0e850b2a85
commit
a750b0f08a
1 changed files with 20 additions and 8 deletions
|
@ -102,14 +102,26 @@ async function bake(data) {
|
||||||
data.progress, // The current position in the recipe
|
data.progress, // The current position in the recipe
|
||||||
data.step // Whether or not to take one step or execute the whole recipe
|
data.step // Whether or not to take one step or execute the whole recipe
|
||||||
);
|
);
|
||||||
self.postMessage({
|
|
||||||
action: "bakeComplete",
|
if (data.input instanceof ArrayBuffer) {
|
||||||
data: Object.assign(response, {
|
self.postMessage({
|
||||||
id: data.id,
|
action: "bakeComplete",
|
||||||
inputNum: data.inputNum,
|
data: Object.assign(response, {
|
||||||
bakeId: data.bakeId
|
id: data.id,
|
||||||
})
|
inputNum: data.inputNum,
|
||||||
});
|
bakeId: data.bakeId
|
||||||
|
})
|
||||||
|
}, [data.input]);
|
||||||
|
} else {
|
||||||
|
self.postMessage({
|
||||||
|
action: "bakeComplete",
|
||||||
|
data: Object.assign(response, {
|
||||||
|
id: data.id,
|
||||||
|
inputNum: data.inputNum,
|
||||||
|
bakeId: data.bakeId
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
self.postMessage({
|
self.postMessage({
|
||||||
action: "bakeError",
|
action: "bakeError",
|
||||||
|
|
Loading…
Reference in a new issue