Skip to content
This repository was archived by the owner on Sep 21, 2021. It is now read-only.

Commit 0f286c6

Browse files
jbhoosreddyjasonLaster
authored andcommitted
execute tasks in order
1 parent 6485fe1 commit 0f286c6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/devtools-utils/src/tests/worker-utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ it("streams a task", async () => {
112112
expect(postMessageMock.mock.calls[1][0]).toEqual({
113113
id,
114114
status: "pending",
115-
data: [2]
115+
data: [1]
116116
});
117117
expect(postMessageMock.mock.calls[2][0]).toEqual({
118118
id,
119119
status: "pending",
120-
data: [1]
120+
data: [2]
121121
});
122122
expect(postMessageMock.mock.calls[3][0]).toEqual({
123123
id,

packages/devtools-utils/src/worker-utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function streamingWorkerHandler(
9292

9393
const results = [];
9494
while (tasks.length !== 0 && isWorking) {
95-
const { callback, context, args } = tasks.pop();
95+
const { callback, context, args } = tasks.shift();
9696
const result = await callback.call(context, args);
9797
results.push(result);
9898
}

0 commit comments

Comments
 (0)