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

Web worker #232

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Web worker #232

wants to merge 2 commits into from

Conversation

stuartlynn
Copy link

I have updated the tileJSON provider to use webworkers. It should fall back to processing on the main thread if no webworkers are available. Might still be some speed up we can get by recycling the webworkers but for now this should offload some of the tile processing.

Haven't had a chance to test it with torque_machine just yet but the examples/tilejson.html example works.

@javisantana

…ey are available. This is probably still not as efficient as it could be as we are not recycling workers.
…sTile. Not sure this is used any more but just to be safe.
}
else{
var worker = this.createProccessTileWorker()
worker.onmessage = function(e){
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand this, why the worker is terminated when recieves a message (maybe is because I don't actully know the webworkers api)

Copy link
Author

Choose a reason for hiding this comment

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

The worker is only terminated when its done. worker.onmessage is triggered when the worker sends a message back to the main thread.

We could recycle the workers but that requires adding some pool logic which seems overkill just now

@javisantana
Copy link
Contributor

sounds pretty good, the CI didn't pass, I think it got stuck

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.

2 participants