Created
June 6, 2020 17:44
-
-
Save daleharvey/d51392144d1f833cd33e719325b73a33 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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