* Listens for messages from a calling function.
*/
addEventListener('message', (message) => {
- console.log(`bip44ckd work received (${performance.now()})`)
const data = JSON.parse(new TextDecoder().decode(message.data ?? message))
process(data).then(results => {
const buf = new TextEncoder().encode(JSON.stringify(results)).buffer
worker: new Worker(url, { type: 'module', eval: true })
}
thread.worker.addEventListener('message', (message) => {
- console.log(`received worker response (${performance.now()})`)
let result = JSON.parse(new TextDecoder().decode(message.data ?? message))
if (!Array.isArray(result)) result = [result]
this.#report(thread, result)