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

Feature: synchronous mode for text processing #122

Open
lojjic opened this issue May 3, 2021 · 2 comments
Open

Feature: synchronous mode for text processing #122

lojjic opened this issue May 3, 2021 · 2 comments

Comments

@lojjic
Copy link
Collaborator

lojjic commented May 3, 2021

Running async in a web worker is a huge win for perceived performance, but there may be cases where running synchronously in the main thread would be preferable. Since worker modules can already fall back to execution in the main thread, we could add some sort of flag to force that.

@lojjic
Copy link
Collaborator Author

lojjic commented May 17, 2021

Thinking about this more closely, just moving to main thread wouldn't make this synchronous on its own; other things such as font loading would have to be made synchronous and the text processing interfaces adjusted as well.

@peterqliu
Copy link

peterqliu commented Aug 10, 2021

I have a workflow that involves multiple worker passes to download data and generate the objects to visualize them. In this context, I'd like the workers to be as versatile as possible. can we bundle the "caller code" and "worker code" in a way that users can run it on specified threads?

To illustrate, I would use that to

  • Invoke new Text() from a worker thread
  • specify an existing worker to do the text-processing work, with a callback to pass the result to the main thread

(Edit: just realized this isn't really about sync mode, but hopefully the threading theme is relevant enough)

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

No branches or pull requests

2 participants