Skip to content

use webworker #9

@serapath

Description

@serapath

@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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions