From 0a8126c2094d2d0800a462d4d0c790d4db421477 Mon Sep 17 00:00:00 2001 From: Rodrigo Kumpera Date: Thu, 22 Feb 2018 15:24:01 -0800 Subject: [WASM] Implement timers. (#7193) * [wasm] Add server.py for those that want to experiment with streaming compilation. * [wasm] Implement System.Threading.Timer. Timer implementation is done in a somewhat convoluted way. First, we change Timer to not depend on a scheduler thread. What we do is call for the runtime to schedule a timed callback to be executed. Next step, the runtime. We add enough plumbing to get this call to JS. Finally, in JS we either call setTimeout or schedule it to be run on the next tick. Oh, wait, timeouts are ignored on non-web environments? Yes, right now its only use case is offline testing, so ain't no time to wait for all this timeouting. --- sdks/wasm/README.md | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sdks/wasm/README.md') diff --git a/sdks/wasm/README.md b/sdks/wasm/README.md index 911dea16273..5dfbb99be2c 100644 --- a/sdks/wasm/README.md +++ b/sdks/wasm/README.md @@ -29,6 +29,9 @@ Once that's done, Start a web server from the SDK directory (where sample.html i python -m SimpleHTTPServer ``` +Unfortunately, the above http server doesn't give wasm binaries the right mime type, which disables WebAssembly stream compilation. +The included server.py script solves this and can be used instead. + Go to `locahost:8000/sample.html` and it should work. [1] https://github.com/kripken/emscripten -- cgit v1.2.3