feat: Add settings
This commit is contained in:
parent
39a1a3983f
commit
0ed3f0e541
16
src/main/java/me/braydon/feather/FeatherSettings.java
Normal file
16
src/main/java/me/braydon/feather/FeatherSettings.java
Normal file
@ -0,0 +1,16 @@
|
||||
package me.braydon.feather;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* Settings for feather, modify these as you wish!
|
||||
*
|
||||
* @author Braydon
|
||||
*/
|
||||
public final class FeatherSettings {
|
||||
/**
|
||||
* The amount of threads to use for {@link FeatherThreads}.
|
||||
*/
|
||||
@Setter @Getter private static int threadCount = 4;
|
||||
}
|
@ -14,7 +14,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
*/
|
||||
public final class FeatherThreads {
|
||||
private static final AtomicInteger ID = new AtomicInteger(0); // The thread id
|
||||
public static final ExecutorService THREAD_POOL = Executors.newFixedThreadPool(4, new ThreadFactoryBuilder()
|
||||
public static final ExecutorService THREAD_POOL = Executors.newFixedThreadPool(FeatherSettings.getThreadCount(), new ThreadFactoryBuilder()
|
||||
.setNameFormat("Feather Thread #" + (ID.incrementAndGet()))
|
||||
.build()); // The thread pool to execute on
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user