better Mono wrapper and get groovy with Gradle

This commit is contained in:
WhatCats
2024-03-29 18:53:43 +01:00
parent 8d1ed04b1d
commit 7763f1e40b
15 changed files with 78 additions and 248 deletions

4
futur-api/build.gradle Normal file
View File

@@ -0,0 +1,4 @@
dependencies {
implementation("org.jetbrains:annotations:24.1.0")
implementation("org.slf4j:slf4j-api:2.0.12")
}

View File

@@ -1,34 +0,0 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
id("java")
id("com.github.johnrengelman.shadow") version "7.1.2"
}
group = "dev.tommyjs"
version = "2.1.2"
repositories {
mavenCentral()
}
dependencies {
implementation("org.jetbrains:annotations:24.1.0")
implementation("org.slf4j:slf4j-api:2.0.9")
testImplementation(platform("org.junit:junit-bom:5.9.1"))
testImplementation("org.junit.jupiter:junit-jupiter")
}
tasks {
build {
dependsOn(shadowJar)
}
withType<ShadowJar> {
exclude("META-INF/**")
}
}
tasks.test {
useJUnitPlatform()
}

View File

@@ -37,14 +37,13 @@ public abstract class AbstractPromise<T> implements Promise<T> {
@Override
public T join(long timeoutMillis) throws TimeoutException {
PromiseCompletion<T> completion = this.completion.get();
if (completion != null) return joinCompletion(completion);
PromiseCompletion<T> completion;
long start = System.currentTimeMillis();
long remainingTimeout = timeoutMillis;
synchronized (this.completion) {
while (completion == null && remainingTimeout > 0){
completion = this.completion.get();
while (completion == null && remainingTimeout > 0) {
try {
this.completion.wait(remainingTimeout);
} catch (InterruptedException e) {