Created
November 16, 2011 19:53
-
-
Save westonruter/1371137 to your computer and use it in GitHub Desktop.
Spawning a web worker from a function object (bypassing need for separate JS file)
This file contains hidden or 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
function fibonacci(){ /*...*/ } | |
var worker = new Worker( | |
"data:application/javascript;base64,"+ | |
btoa('(' + fibonacci.toString().replace(/function\s+\w+/, 'function') + ')();') | |
); | |
// More: https://plus.google.com/113853198722136596993/posts/hAtcYGc5xcw |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment