Created
November 28, 2014 02:27
-
-
Save Narazaka/45f6bf986c7380bd8d1a to your computer and use it in GitHub Desktop.
AYA5Worker.coffee
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
self.importScripts("encoding.min.js") | |
self.importScripts("aya5.js") | |
self.importScripts("nativeshiori.js") | |
shiori = new AYA5() | |
shiori.Module.logReadFiles = true | |
shiorihandler = null | |
self.onmessage = ({data: {event, data}}) -> | |
switch event | |
when "load" | |
shiorihandler = new NativeShiori(shiori, data, true) | |
code = shiorihandler.load('/home/web_user') | |
self.postMessage({event: "loaded", error: null, data: code}) | |
when "request" | |
request = data | |
response = shiorihandler.request(request) | |
self.postMessage({event: "response", error: null, data: response}) | |
when "unload" | |
code = shiorihandler.unload() | |
self.postMessage({event: "unloaded", error: null, data: code}) | |
else throw new Error(event + " event not support") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment