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

implement Worker.terminate() and self.close() #4684

Merged
merged 11 commits into from
Apr 9, 2020

Conversation

bartlomieju
Copy link
Member

@bartlomieju bartlomieju commented Apr 9, 2020

Fixed #4342
Fixed #4080

@bartlomieju bartlomieju changed the title [WIP] Worker.terminate() implement Worker.terminate() and self.close() Apr 9, 2020
@bartlomieju bartlomieju changed the title implement Worker.terminate() and self.close() implement Worker.terminate() and self.close() Apr 9, 2020
cli/tests/subdir/racy_worker.js Outdated Show resolved Hide resolved
cli/tests/workers_test.ts Outdated Show resolved Hide resolved
cli/web_worker.rs Show resolved Hide resolved
cli/web_worker.rs Outdated Show resolved Hide resolved
cli/web_worker.rs Outdated Show resolved Hide resolved
@bartlomieju bartlomieju requested a review from ry April 9, 2020 18:49
/// This struct is used by host as well as worker itself.
///
/// Host uses it to communicate with worker and terminate it,
/// while worker uses it only to finish execution on `self.close()`.
Copy link
Member

Choose a reason for hiding this comment

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

Thanks

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

LGTM - nice work Bartek!

@bartlomieju bartlomieju merged commit be71885 into denoland:master Apr 9, 2020
@bartlomieju bartlomieju deleted the terminate_worker branch April 9, 2020 22:15
@bartlomieju bartlomieju mentioned this pull request Apr 9, 2020
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.

Worker.prototype.terminate panicked Worker postMessage and close race condition
2 participants