Skip to content

Add clarification to the driver close and closeAsync methods #1537

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions driver/src/main/java/org/neo4j/driver/Driver.java
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,10 @@ default AsyncSession asyncSession(SessionConfig sessionConfig) {
* Close all the resources assigned to this driver, including open connections and IO threads.
* <p>
* This operation works the same way as {@link #closeAsync()} but blocks until all resources are closed.
* <p>
* Please note that this method is intended for graceful shutdown only and expects that all driver interactions have
* either been finished or no longer awaited for. Pending driver API calls may not be completed after this method is
* invoked.
*/
@Override
void close();
Expand All @@ -343,6 +347,10 @@ default AsyncSession asyncSession(SessionConfig sessionConfig) {
* <p>
* This operation is asynchronous and returns a {@link CompletionStage}. This stage is completed with
* {@code null} when all resources are closed. It is completed exceptionally if termination fails.
* <p>
* Please note that this method is intended for graceful shutdown only and expects that all driver interactions have
* either been finished or no longer awaited for. Pending driver API calls may not be completed after this method is
* invoked.
*
* @return a {@link CompletionStage completion stage} that represents the asynchronous close.
*/
Expand Down