Mercurial > hg > orthanc-stone
annotate Platforms/Wasm/WasmDelayedCallExecutor.js @ 431:26b90b110719 am-vsol-upgrade
added DelayedCallExecutor to avoid using sleep() in C++ that consumes 100% CPU once executed in WASM
author | am@osimis.io |
---|---|
date | Thu, 29 Nov 2018 19:25:15 +0100 |
parents | |
children | 5055031f4a06 |
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() { |
26b90b110719
added DelayedCallExecutor to avoid using sleep() in C++ that consumes 100% CPU once executed in WASM
am@osimis.io
parents:
diff
changeset
|
4 WasmDelayedCallExecutor_ExecuteCallback(callable/*, payload*/); |
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 }); |