Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save daleharvey/d51392144d1f833cd33e719325b73a33 to your computer and use it in GitHub Desktop.
Save daleharvey/d51392144d1f833cd33e719325b73a33 to your computer and use it in GitHub Desktop.
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-env mozilla/chrome-worker */
"use strict";
importScripts("resource://gre/modules/workers/require.js");
const PromiseWorker = require("resource://gre/modules/workers/PromiseWorker.js");
const DEBUG = false;
var worker = new PromiseWorker.AbstractWorker();
worker.dispatch = function(method, args = []) {
return Agent[method](...args);
};
worker.postMessage = function(result, ...transfers) {
self.postMessage(result, ...transfers);
};
worker.close = function() {
self.close();
};
worker.log = function(...args) {
if (DEBUG) {
dump("RegionWorker: " + args.join(" ") + "\n");
}
};
self.addEventListener("message", msg => worker.handleMessage(msg));
var Agent = {
/**
* Parses structured article data from a document.
*
*/
geoCode(location) {
let plainMap = loadPlainMap();
},
};
async function loadPlainMap() {
return null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment