Use custom BufferTimeout implementation

This commit is contained in:
Andrea Cavalli 2021-01-27 03:29:34 +01:00
parent 4fc610c1ac
commit f5e8eecf7c

View File

@ -25,10 +25,10 @@ import it.tdlight.tdlibsession.td.middle.TdResultList;
import it.tdlight.tdlibsession.td.middle.TdResultListMessageCodec; import it.tdlight.tdlibsession.td.middle.TdResultListMessageCodec;
import it.tdlight.tdlibsession.td.middle.TdResultMessage; import it.tdlight.tdlibsession.td.middle.TdResultMessage;
import it.tdlight.utils.BinlogUtils; import it.tdlight.utils.BinlogUtils;
import it.tdlight.utils.BufferTimeOutPublisher;
import it.tdlight.utils.MonoUtils; import it.tdlight.utils.MonoUtils;
import java.net.ConnectException; import java.net.ConnectException;
import java.time.Duration; import java.time.Duration;
import java.util.List;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import reactor.core.publisher.Flux; import reactor.core.publisher.Flux;
@ -344,9 +344,9 @@ public class AsyncTdMiddleEventBusServer extends AbstractVerticle {
return update; return update;
} }
})) }))
//.transform(normal -> new BufferTimeOutPublisher<>(normal, Math.max(1, tdOptions.getEventsSize()), local ? Duration.ofMillis(1) : Duration.ofMillis(100))) .transform(normal -> new BufferTimeOutPublisher<>(normal, Math.max(1, tdOptions.getEventsSize()), local ? Duration.ofMillis(1) : Duration.ofMillis(100)))
//.bufferTimeout(Math.max(1, tdOptions.getEventsSize()), local ? Duration.ofMillis(1) : Duration.ofMillis(100)) //.bufferTimeout(Math.max(1, tdOptions.getEventsSize()), local ? Duration.ofMillis(1) : Duration.ofMillis(100))
.map(List::of) //.map(List::of)
.map(TdResultList::new); .map(TdResultList::new);
var fluxCodec = new TdResultListMessageCodec(); var fluxCodec = new TdResultListMessageCodec();