mirror of
https://github.com/tommyskeff/futur4j.git
synced 2026-01-18 07:16:45 +00:00
better Mono wrapper and get groovy with Gradle
This commit is contained in:
4
futur-api/build.gradle
Normal file
4
futur-api/build.gradle
Normal file
@@ -0,0 +1,4 @@
|
||||
dependencies {
|
||||
implementation("org.jetbrains:annotations:24.1.0")
|
||||
implementation("org.slf4j:slf4j-api:2.0.12")
|
||||
}
|
||||
@@ -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()
|
||||
}
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user