Update reactor, fix scheduling

This commit is contained in:
Andrea Cavalli 2021-09-09 12:10:50 +02:00
parent 497c4f75e1
commit 84bf1eee85
5 changed files with 8 additions and 13 deletions

View File

@ -112,12 +112,12 @@
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
<version>3.4.8</version>
<version>3.4.9</version>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-tools</artifactId>
<version>3.4.8</version>
<version>3.4.9</version>
</dependency>
<dependency>
<groupId>com.akaita.java</groupId>

View File

@ -120,6 +120,6 @@ public class AsyncTdDirectImpl implements AsyncTdDirect {
// Try to emit false, so that if it has not been closed from tdlib, now it is explicitly false.
closedFromTd.tryEmitValue(false);
})
.subscribeOn(Schedulers.parallel());
.subscribeOn(Schedulers.boundedElastic());
}
}

View File

@ -97,7 +97,7 @@ public class AsyncTdMiddleDirect extends AbstractVerticle implements AsyncTdMidd
.doOnNext(s -> logger.trace("Received update from tdlib: {}", s.getClass().getSimpleName()))
.doOnError(ex -> logger.info("TdMiddle verticle error", ex))
.doOnTerminate(() -> logger.debug("TdMiddle verticle stopped"))
.subscribeOn(Schedulers.parallel());
.subscribeOn(Schedulers.boundedElastic());
}
@Override

View File

@ -107,7 +107,6 @@ public class AsyncTdMiddleEventBusServer extends AbstractVerticle {
}
return onSuccessfulStartRequest(td, botAddress, botAlias, botId, local);
})
.flatMap(voidMono -> voidMono.hide().subscribeOn(Schedulers.boundedElastic()))
.doOnSuccess(s -> logger.trace("Stated verticle"))
);
}

View File

@ -38,8 +38,7 @@ public class BinlogUtils {
)
// Open file
.map(x -> new BinlogAsyncFile(vertxFilesystem, path))
.single()
.publishOn(Schedulers.boundedElastic());
.single();
}
public static Mono<Void> saveBinlog(BinlogAsyncFile binlog, Buffer data) {
@ -66,8 +65,7 @@ public class BinlogUtils {
.then(retrieveBinlog(vertxFilesystem, binlogPath))
)
.single()
.then()
.publishOn(Schedulers.boundedElastic());
.then();
}
public static Mono<Void> cleanSessionPath(FileSystem vertxFilesystem,
@ -87,8 +85,7 @@ public class BinlogUtils {
.flatMap(file -> vertxFilesystem.rxDeleteRecursive(file, true).as(MonoUtils::toMono))
.onErrorResume(ex -> Mono.empty())
.then()
)
.publishOn(Schedulers.boundedElastic());
);
}
public static String humanReadableByteCountBin(long bytes) {
@ -126,7 +123,6 @@ public class BinlogUtils {
var opts = new DeliveryOptions().setLocalOnly(local).setSendTimeout(Duration.ofSeconds(10).toMillis());
tuple.getT1().reply(new EndSessionMessage(botId, tuple.getT2()), opts);
})
.then()
.publishOn(Schedulers.boundedElastic());
.then();
}
}