From 07c1e6c836b8b4792e436ce5bb6dfe585f1367d9 Mon Sep 17 00:00:00 2001 From: Andrea Cavalli Date: Tue, 11 Jan 2022 16:00:56 +0100 Subject: [PATCH] Bugfixes --- pom.xml | 13 ++++++++++++- .../tdlight/reactiveapi/ReactiveApiPublisher.java | 5 ++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 8c37e74..94d4046 100644 --- a/pom.xml +++ b/pom.xml @@ -48,7 +48,7 @@ it.tdlight tdlight-java-bom - 2.8.0.1 + 2.8.0.2 pom import @@ -109,6 +109,12 @@ io.atomix atomix ${atomix.version} + + + org.ow2.asm + asm + + io.atomix @@ -120,6 +126,11 @@ atomix-primary-backup ${atomix.version} + + org.ow2.asm + asm + 9.2 + io.projectreactor reactor-core diff --git a/src/main/java/it/tdlight/reactiveapi/ReactiveApiPublisher.java b/src/main/java/it/tdlight/reactiveapi/ReactiveApiPublisher.java index 5fa3caa..3d353b6 100644 --- a/src/main/java/it/tdlight/reactiveapi/ReactiveApiPublisher.java +++ b/src/main/java/it/tdlight/reactiveapi/ReactiveApiPublisher.java @@ -134,14 +134,13 @@ public abstract class ReactiveApiPublisher { return transformedFlux; }) - .publish(); + .publish(256); publishedResultingEvents // Obtain only TDLib-bound events .filter(s -> s instanceof TDLibBoundResultingEvent) .map(s -> ((TDLibBoundResultingEvent) s).action()) - .limitRate(4) // Buffer up to 64 requests to avoid halting the event loop, throw an error if too many requests are buffered .onBackpressureBuffer(64, BufferOverflowStrategy.ERROR) @@ -159,7 +158,7 @@ public abstract class ReactiveApiPublisher { .doOnError(ex -> LOG.error("Failed to receive the response for special request {}\n" + " The instance will be closed", function, ex)) .onErrorResume(ex -> Mono.just(new OnUpdateError(liveId, userId, new TdApi.Error(500, ex.getMessage())))) - ) + , 1024) .doOnError(ex -> LOG.error("Failed to receive resulting events. The instance will be closed", ex)) .onErrorResume(ex -> Mono.just(new OnUpdateError(liveId, userId, new TdApi.Error(500, ex.getMessage()))))