Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: transfer from worker fixed #455

Merged
merged 13 commits into from
Jun 28, 2024
Merged

Conversation

LeonidPolukhin
Copy link
Contributor

No description provided.

@josdejong
Copy link
Owner

Thanks for debugging and fixing this issue Leonid.

Can you add a unit test too, to prevent future regressions?

@w1nklr
Copy link
Contributor

w1nklr commented Jun 27, 2024

Hi @josdejong
I'm afraid it's the same problem than #439 (comment).

Again, if there is a way to do unit tests in browser env, I would be more than happy to (learn the way to do and) to implement the test ! But for now, we're clueless with @LeonidPolukhin ...

@josdejong
Copy link
Owner

Ok makes sense. Let's not try to write an automated test then.

Do you have a minimal browser example that I can test manually to verify the solution?

@LeonidPolukhin
Copy link
Contributor Author

Ok makes sense. Let's not try to write an automated test then.

Do you have a minimal browser example that I can test manually to verify the solution?

I could add one more example in, for instance, examples/webpack5 or extend the existing one. Which variant would you prefer?

@w1nklr
Copy link
Contributor

w1nklr commented Jun 27, 2024

I'll check with @LeonidPolukhin

I saw there is an example with webpack5 (examples/webpack5). We might be able to enrich this example...

@LeonidPolukhin
Copy link
Contributor Author

I'll check with @LeonidPolukhin

I saw there is an example with webpack5 (examples/webpack5). We might be able to enrich this example...

Extended the example in webpack 5. Worker creates an array of the requested size and transfers it back to the main thread using workerEmit. After that it returns boolean value indicating whether the array buffer is detached. With the current version of workerpool the example shows that arrays are cloned but with the fix applied they are transferred.

@josdejong
Copy link
Owner

Thanks, I tried it out and indeed it works like expected 👍

@josdejong josdejong merged commit 007a3d4 into josdejong:master Jun 28, 2024
4 checks passed
@josdejong
Copy link
Owner

The fix is published now in v9.1.3, thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants