From 431e4fc9d1657a50ebc34b8ac24f9bfaea06417f Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Sat, 17 Sep 2022 19:39:05 +0800 Subject: Initial move to babel + change fetch to use async/await --- src/utils/nonPooledThread.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/utils/nonPooledThread.js (limited to 'src/utils/nonPooledThread.js') diff --git a/src/utils/nonPooledThread.js b/src/utils/nonPooledThread.js new file mode 100644 index 0000000..4720700 --- /dev/null +++ b/src/utils/nonPooledThread.js @@ -0,0 +1,14 @@ +let Executors = Java.type("java.util.concurrent.Executors") + +class NonPooledThread { + constructor(fun) { + this.fun = fun + this.executor = Executors.newSingleThreadExecutor() + } + + start() { + this.executor.execute(this.fun) + } +} + +export default NonPooledThread \ No newline at end of file -- cgit