Compare commits
No commits in common. "0228787568fda2bb5b5dd9e89d84e1453320bea0" and "10f4ac013e337086b99303b2641786af8d52e4de" have entirely different histories.
0228787568
...
10f4ac013e
@ -1,4 +1,11 @@
|
|||||||
dependencies {
|
dependencies {
|
||||||
implementation 'org.postgresql:postgresql:42.5.0'
|
implementation 'org.postgresql:postgresql:42.5.0'
|
||||||
testImplementation 'com.google.code.gson:gson:2.10'
|
testImplementation 'com.google.code.gson:gson:2.10'
|
||||||
|
testImplementation "org.junit.jupiter:junit-jupiter-api:${project.junit_version}"
|
||||||
|
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${project.junit_version}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test {
|
||||||
|
useJUnitPlatform()
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
package fr.altarik.toolbox;
|
|
||||||
|
|
||||||
public class Main {
|
|
||||||
public static void main(String[] args) {
|
|
||||||
System.out.println("Hello world!");
|
|
||||||
}
|
|
||||||
}
|
|
@ -9,6 +9,9 @@ dependencies {
|
|||||||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
||||||
|
|
||||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
||||||
|
|
||||||
|
testImplementation "org.junit.jupiter:junit-jupiter-api:${project.junit_version}"
|
||||||
|
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${project.junit_version}"
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
@ -34,3 +37,8 @@ tasks.withType(JavaCompile).configureEach {
|
|||||||
it.options.release = targetVersion
|
it.options.release = targetVersion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
test {
|
||||||
|
useJUnitPlatform()
|
||||||
|
}
|
||||||
|
@ -2,14 +2,13 @@ package fr.altarik.toolbox.task;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Queue;
|
|
||||||
|
|
||||||
public class Scheduler implements Runnable {
|
public class Scheduler implements Runnable {
|
||||||
|
|
||||||
private final Queue<SchedulerTaskData> tasks;
|
private final List<SchedulerTaskData> tasks;
|
||||||
private final SendTaskWorkerI worker;
|
private final SendTaskWorkerI worker;
|
||||||
|
|
||||||
public Scheduler(SendTaskWorkerI worker, Queue<SchedulerTaskData> tasks) {
|
public Scheduler(SendTaskWorkerI worker, List<SchedulerTaskData> tasks) {
|
||||||
this.worker = worker;
|
this.worker = worker;
|
||||||
this.tasks = tasks;
|
this.tasks = tasks;
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,7 @@ package fr.altarik.toolbox.task.async;
|
|||||||
|
|
||||||
import fr.altarik.toolbox.task.*;
|
import fr.altarik.toolbox.task.*;
|
||||||
|
|
||||||
import java.util.Queue;
|
import java.util.Stack;
|
||||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
@ -15,7 +14,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
public class AsyncPeriodicTasks implements PeriodicTaskI, AsyncTaskI, SendTaskWorkerI {
|
public class AsyncPeriodicTasks implements PeriodicTaskI, AsyncTaskI, SendTaskWorkerI {
|
||||||
|
|
||||||
private final ExecutorService worker;
|
private final ExecutorService worker;
|
||||||
private final Queue<SchedulerTaskData> tasks;
|
private final Stack<SchedulerTaskData> tasks;
|
||||||
protected final Scheduler scheduler;
|
protected final Scheduler scheduler;
|
||||||
private final ServerTickListener listener;
|
private final ServerTickListener listener;
|
||||||
|
|
||||||
@ -27,7 +26,7 @@ public class AsyncPeriodicTasks implements PeriodicTaskI, AsyncTaskI, SendTaskWo
|
|||||||
} else {
|
} else {
|
||||||
worker = Executors.newFixedThreadPool(numberOfWorker);
|
worker = Executors.newFixedThreadPool(numberOfWorker);
|
||||||
}
|
}
|
||||||
tasks = new ConcurrentLinkedQueue<>();
|
tasks = new Stack<>();
|
||||||
this.scheduler = new Scheduler(this, tasks);
|
this.scheduler = new Scheduler(this, tasks);
|
||||||
this.listener = new ServerTickListener(scheduler);
|
this.listener = new ServerTickListener(scheduler);
|
||||||
}
|
}
|
||||||
|
@ -2,17 +2,17 @@ package fr.altarik.toolbox.task.sync;
|
|||||||
|
|
||||||
import fr.altarik.toolbox.task.*;
|
import fr.altarik.toolbox.task.*;
|
||||||
|
|
||||||
import java.util.Queue;
|
import java.util.ArrayList;
|
||||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
import java.util.List;
|
||||||
|
|
||||||
public class PeriodicSyncTask implements PeriodicTaskI, SendTaskWorkerI {
|
public class PeriodicSyncTask implements PeriodicTaskI, SendTaskWorkerI {
|
||||||
|
|
||||||
private final ServerTickListener listener;
|
private final ServerTickListener listener;
|
||||||
private final Queue<SchedulerTaskData> tasks;
|
private final List<SchedulerTaskData> tasks;
|
||||||
protected final Scheduler scheduler;
|
protected final Scheduler scheduler;
|
||||||
|
|
||||||
private PeriodicSyncTask() {
|
private PeriodicSyncTask() {
|
||||||
this.tasks = new ConcurrentLinkedQueue<>();
|
this.tasks = new ArrayList<>(2);
|
||||||
this.scheduler = new Scheduler(this, tasks);
|
this.scheduler = new Scheduler(this, tasks);
|
||||||
this.listener = new ServerTickListener(scheduler);
|
this.listener = new ServerTickListener(scheduler);
|
||||||
}
|
}
|
||||||
|
@ -2,17 +2,17 @@ package fr.altarik.toolbox.task.sync;
|
|||||||
|
|
||||||
import fr.altarik.toolbox.task.*;
|
import fr.altarik.toolbox.task.*;
|
||||||
|
|
||||||
import java.util.Queue;
|
import java.util.ArrayList;
|
||||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
import java.util.List;
|
||||||
|
|
||||||
public class SyncTask implements TaskI, SendTaskWorkerI {
|
public class SyncTask implements TaskI, SendTaskWorkerI {
|
||||||
|
|
||||||
private final ServerTickListener listener;
|
private final ServerTickListener listener;
|
||||||
private final Queue<SchedulerTaskData> tasks;
|
private final List<SchedulerTaskData> tasks;
|
||||||
protected final Scheduler scheduler;
|
protected final Scheduler scheduler;
|
||||||
|
|
||||||
private SyncTask() {
|
private SyncTask() {
|
||||||
this.tasks = new ConcurrentLinkedQueue<>();
|
this.tasks = new ArrayList<>(2);
|
||||||
this.scheduler = new Scheduler(this, tasks);
|
this.scheduler = new Scheduler(this, tasks);
|
||||||
this.listener = new ServerTickListener(scheduler);
|
this.listener = new ServerTickListener(scheduler);
|
||||||
}
|
}
|
||||||
|
@ -27,19 +27,12 @@ subprojects {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
|
||||||
testImplementation "org.junit.jupiter:junit-jupiter-api:${project.junit_version}"
|
|
||||||
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${project.junit_version}"
|
|
||||||
}
|
|
||||||
|
|
||||||
java {
|
java {
|
||||||
withSourcesJar()
|
withSourcesJar()
|
||||||
withJavadocJar()
|
withJavadocJar()
|
||||||
}
|
}
|
||||||
|
|
||||||
test {
|
|
||||||
useJUnitPlatform()
|
|
||||||
}
|
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven {
|
maven {
|
||||||
|
@ -8,6 +8,6 @@ loader_version=0.14.12
|
|||||||
fabric_version=0.70.0+1.19.3
|
fabric_version=0.70.0+1.19.3
|
||||||
|
|
||||||
maven_group=fr.altarik.toolbox
|
maven_group=fr.altarik.toolbox
|
||||||
maven_version=4.0.0-SNAPSHOT
|
maven_version=3.0.1-SNAPSHOT
|
||||||
repo_username=Altarik
|
repo_username=Altarik
|
||||||
repo_password=password
|
repo_password=password
|
@ -10,5 +10,4 @@ pluginManagement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rootProject.name = 'Toolbox'
|
rootProject.name = 'Toolbox'
|
||||||
include(':Tasks', ':Database', ':Pagination')
|
include(':Tasks', ':Database')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user