Skip to content

Commit 08c8561

Browse files
author
Zhen Li
committed
Avoid a queue for shaded record publisher
By default, when creating a publisher via `Flux.create` a `BufferAsyncSink` will be used and a queue is created to buffer all data the client cannot process in time. With reactor being shaded, the reactor users cannot benifit from this queue and will have to create this queue again when creating from driver's record publisher. Thus we configure the driver to create a publisher without any active buffering. The application will be fully in charge of buffer consumed data instead.
1 parent 97b1532 commit 08c8561

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

driver/src/main/java/org/neo4j/driver/internal/reactive/InternalRxStatementResult.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@
2626
import java.util.function.Supplier;
2727

2828
import org.neo4j.driver.Record;
29+
import org.neo4j.driver.internal.cursor.RxStatementResultCursor;
2930
import org.neo4j.driver.internal.util.Futures;
3031
import org.neo4j.driver.reactive.RxStatementResult;
31-
import org.neo4j.driver.internal.cursor.RxStatementResultCursor;
3232
import org.neo4j.driver.summary.ResultSummary;
3333

34+
import static reactor.core.publisher.FluxSink.OverflowStrategy.IGNORE;
35+
3436
public class InternalRxStatementResult implements RxStatementResult
3537
{
3638
private Supplier<CompletionStage<RxStatementResultCursor>> cursorFutureSupplier;
@@ -83,7 +85,7 @@ else if ( e != null )
8385
Throwable error = Futures.completionExceptionCause( completionError );
8486
sink.error( error );
8587
}
86-
} ) );
88+
} ), IGNORE );
8789
}
8890

8991
private CompletionStage<RxStatementResultCursor> getCursorFuture()

0 commit comments

Comments
 (0)