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

use webworker #9

Open
1 task
serapath opened this issue May 5, 2020 · 0 comments
Open
1 task

use webworker #9

serapath opened this issue May 5, 2020 · 0 comments

Comments

@serapath
Copy link
Member

serapath commented May 5, 2020

@todo

  • fix solcjs compiler to use webworker

Currently we have 1 module (solc-js) and we need is 2 more modules:

  1. solc-js-webworker (which does require('solc-js'))
    • and it get's loaded in a web worker
    • listens to messages like:
        onmessage = event => {
          const [msgID, from, path, ref, type, body] = event.data
        }
    • and it receives messages and calls solc-js methods
  2. solc-js-proxy
    • it loads a web worker with solc-js-webworker
    • it offers the same methods as solc-js
    • it forwards method calls to the webworker
        solcjs_worker.postMessage([msgID, from, path, ref, type, body])
    • it listens for responses from the webworker
        solcjs_worker.onmessage = event => {
          const [msgID, from, path, ref, type, body] = event.data
        }
    • it responds to the original method call with the result, so solc-js methods need to be async/await
@serapath serapath mentioned this issue May 5, 2020
24 tasks
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

1 participant