
* feat: ServiceWorkerMain * refactor: disconnect remote * handle version_info_ nullptr case * initiate finish request when possible and enumerate errors * explicit name for test method * oops * fix: wait for redundant version to stop before destroying * docs: clarify when undefined is returned * chore: remove extra semicolons
17 lines
493 B
TypeScript
17 lines
493 B
TypeScript
const { ServiceWorkerMain } = process._linkedBinding('electron_browser_service_worker_main');
|
|
|
|
ServiceWorkerMain.prototype.startTask = function () {
|
|
// TODO(samuelmaddock): maybe make timeout configurable in the future
|
|
const hasTimeout = false;
|
|
const { id, ok } = this._startExternalRequest(hasTimeout);
|
|
|
|
if (!ok) {
|
|
throw new Error('Unable to start service worker task.');
|
|
}
|
|
|
|
return {
|
|
end: () => this._finishExternalRequest(id)
|
|
};
|
|
};
|
|
|
|
module.exports = ServiceWorkerMain;
|