Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

SOLCjs to use webworker #135

Closed
ninabreznik opened this issue Jun 9, 2019 · 3 comments
Closed

SOLCjs to use webworker #135

ninabreznik opened this issue Jun 9, 2019 · 3 comments
Assignees

Comments

@ninabreznik
Copy link
Contributor

  • fix solcjs compiler to use webworker
@serapath
Copy link
Contributor

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants