[web-db] implement basic app-worker connection types
Summary:
Adding basic types and concept of sharing information between worker and app. Current type (PING/PONG) will be used probably only for development, will add more concrete ones in next diffs.
Depends on D6990
Test Plan:
Run this code:
const webDbWorker = new SharedWorker('/worker/webDatabase'); webDbWorker.port.onmessage = function (e) { console.log('message from worker: ', e.data); }; const message: WorkerRequestMessage = { type: workerRequestMessageTypes.PING, text: 'hi from app', }; webDbWorker.port.postMessage(message);
and check results in browser, desktop and shared worker consoles.
Check error flow.
Reviewers: michal, tomek
Reviewed By: tomek
Subscribers: ashoat, atul
Differential Revision: https://phab.comm.dev/D6991