scratch-vm/test/fixtures/dispatch-test-worker.js
Christopher Willis-Ford b4c0cfe940 Refactor common code in {central,worker}-dispatch
Central dispatch and worker dispatch share most of their code now by
inheriting from a new shared dispatch class.

Also, the format of passed messages has been altered to make it easier
to understand in a debugger.
2017-08-09 17:30:00 -04:00

11 lines
430 B
JavaScript

const dispatch = require('../../src/dispatch/worker-dispatch');
const DispatchTestService = require('./dispatch-test-service');
const log = require('../../src/util/log');
dispatch.setService('RemoteDispatchTest', new DispatchTestService());
dispatch.waitForConnection.then(() => {
dispatch.call('test', 'onWorkerReady').catch(e => {
log(`Test worker failed to call onWorkerReady: ${JSON.stringify(e)}`);
});
});