Mercurial > hg > orthanc-stone
annotate Platforms/Wasm/WasmDelayedCallExecutor.js @ 1391:32272ecfc6c2
Drilled a hole through the abstractions to be able to match
an SdlViewport with its SDL window ID to support dispatching
event loop SDL events as viewport/controller/compositor
method calls.
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Tue, 28 Apr 2020 13:26:41 +0200 |
parents | 5055031f4a06 |
children |
rev | line source |
---|---|
431
26b90b110719
added DelayedCallExecutor to avoid using sleep() in C++ that consumes 100% CPU once executed in WASM
am@osimis.io
parents:
diff
changeset
|
1 mergeInto(LibraryManager.library, { |
26b90b110719
added DelayedCallExecutor to avoid using sleep() in C++ that consumes 100% CPU once executed in WASM
am@osimis.io
parents:
diff
changeset
|
2 WasmDelayedCallExecutor_Schedule: function(callable, timeoutInMs/*, payload*/) { |
26b90b110719
added DelayedCallExecutor to avoid using sleep() in C++ that consumes 100% CPU once executed in WASM
am@osimis.io
parents:
diff
changeset
|
3 setTimeout(function() { |
466
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
431
diff
changeset
|
4 window.WasmDelayedCallExecutor_ExecuteCallback(callable/*, payload*/); |
431
26b90b110719
added DelayedCallExecutor to avoid using sleep() in C++ that consumes 100% CPU once executed in WASM
am@osimis.io
parents:
diff
changeset
|
5 }, timeoutInMs); |
26b90b110719
added DelayedCallExecutor to avoid using sleep() in C++ that consumes 100% CPU once executed in WASM
am@osimis.io
parents:
diff
changeset
|
6 } |
26b90b110719
added DelayedCallExecutor to avoid using sleep() in C++ that consumes 100% CPU once executed in WASM
am@osimis.io
parents:
diff
changeset
|
7 }); |