Make use of Java 21 virtual threads in GlobalThreadPool
This commit is contained in:
parent
3d6229ec13
commit
55f9093d62
|
@ -8,6 +8,7 @@
|
|||
* Made sure, that @winkru's fix to faster check, if a Chaturbate model is
|
||||
online is merged correctly into my codebase. This should reduce 429 errors
|
||||
and speed up the online check quite a bit.
|
||||
* Java 21 is now required
|
||||
* Changes by @WinkRU
|
||||
* Added setting to restrict recording by bit rate
|
||||
* Added setting to use the shortest side to restrict the resolution
|
||||
|
|
|
@ -25,7 +25,7 @@ public abstract class MyFreeCamsAbstractUpdateService extends PaginatedScheduled
|
|||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
} catch (Exception e) {
|
||||
log.debug("Couldn't update model on line state", e);
|
||||
log.debug("Couldn't update model online state", e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
package ctbrec;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
@Slf4j
|
||||
public class GlobalThreadPool {
|
||||
|
||||
private static final ExecutorService threadPool = Executors.newWorkStealingPool();
|
||||
private static final ExecutorService threadPool = Executors.newThreadPerTaskExecutor(r -> Thread
|
||||
.ofVirtual()
|
||||
.name("GlobalWorker-" + UUID.randomUUID().toString().substring(0, 8))
|
||||
.unstarted(r)
|
||||
);
|
||||
|
||||
private GlobalThreadPool() {
|
||||
}
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
<version.javafx>21.0.1</version.javafx>
|
||||
<version.junit>5.7.2</version.junit>
|
||||
<jackson.version>2.15.1</jackson.version>
|
||||
|
|
Loading…
Reference in New Issue