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

[DONT MERGE] feat(webworker): Reworking Web Worker API and new WebWorkerManager #880

Open
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

sedghi
Copy link
Member

@sedghi sedghi commented Nov 9, 2023

Most likely we won't merge this into main the diff is just easier to see to the main

We will merge this one first , and in cornerstone3D 2.0 we will move all decoders to the new manager as well to have central place to manage all.

Context

This PR reworks the web worker API and proposes a new set of methods to work with workers to make developers life so much easier to be able to run a function of the main thread

Changes & Results

  • adds webWorkerManager to the Core
  • Moves all the decoding in dicomImageLoader to use the new worker manager (previously done via worker-loader)

Testing

You should be able to follow the added documentation to easily write, register and execute a function in a way that makes a lot of sense.

Checklist

PR

  • [] My Pull Request title is descriptive, accurate and follows the
    semantic-release format and guidelines.

Code

Public Documentation Updates

  • [] The documentation page has been updated as necessary for any public API
    additions or removals.

Tested Environment

  • [] "OS:
  • [] "Node version:
  • [] "Browser:

Copy link

netlify bot commented Nov 9, 2023

Deploy Preview for cornerstone-3d-docs ready!

Name Link
🔨 Latest commit 42b87b3
🔍 Latest deploy log https://app.netlify.com/sites/cornerstone-3d-docs/deploys/654e4630a5cffc0009d46fa3
😎 Deploy Preview https://deploy-preview-880--cornerstone-3d-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@sedghi sedghi changed the title feat/workerpool feat(webworker): Reworking Web Worker API and new WebWorkerManager Nov 9, 2023
}

this.workerTypes[workerName].instances.forEach((workerInstance) => {
workerInstance[Comlink.releaseProxy]();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if the worker is running something? Does Comlink waits for it to complete the task before destroying it?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should not be worried about that since all workers may not be destroyed at any time, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that is a problem

@sedghi sedghi changed the title feat(webworker): Reworking Web Worker API and new WebWorkerManager [DONT MERGE] feat(webworker): Reworking Web Worker API and new WebWorkerManager Nov 15, 2023
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.

None yet

2 participants