- All Implemented Interfaces:
ResultCursor
,AsyncResultCursor
,org.neo4j.driver.internal.FailableCursor
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAsynchronously retrieve the result summary.Discarding all unconsumed records and returning failure if there is any pull errors.forEachAsync
(Consumer<Record> action) Asynchronously apply the givenaction
to every record in the result, yielding a summary of it.Determine if result is open.keys()
Retrieve the keys of the records this result cursor contains.Asynchronously retrieve and store the entire result stream.<T> CompletionStage<List<T>>
Asynchronously retrieve and store a projection of the entire result.Asynchronously navigate to and retrieve the nextRecord
in this result.Asynchronously investigate the next upcomingRecord
without moving forward in the result.Pulling all unconsumed records into memory and returning failure if there is any pull errors.Asynchronously return the first record in the result, failing if there is not exactly one record left in the stream.
-
Constructor Details
-
DisposableAsyncResultCursor
-
-
Method Details
-
keys
Description copied from interface:ResultCursor
Retrieve the keys of the records this result cursor contains.- Specified by:
keys
in interfaceResultCursor
- Returns:
- list of all keys.
-
consumeAsync
Description copied from interface:ResultCursor
Asynchronously retrieve the result summary.If the records in the result is not fully consumed, then calling this method will exhausts the result.
If you want to access unconsumed records after summary, you shall use
Result.list()
to buffer all records into memory before summary.- Specified by:
consumeAsync
in interfaceResultCursor
- Returns:
- a
CompletionStage
completed with a summary for the whole query result. Stage can also be completed exceptionally if query execution fails.
-
nextAsync
Description copied from interface:ResultCursor
Asynchronously navigate to and retrieve the nextRecord
in this result. Returned stage can containnull
if end of records stream has been reached.- Specified by:
nextAsync
in interfaceResultCursor
- Returns:
- a
CompletionStage
completed with a record ornull
. Stage can also be completed exceptionally if query execution fails.
-
peekAsync
Description copied from interface:ResultCursor
Asynchronously investigate the next upcomingRecord
without moving forward in the result. Returned stage can containnull
if end of records stream has been reached.- Specified by:
peekAsync
in interfaceResultCursor
- Returns:
- a
CompletionStage
completed with a record ornull
. Stage can also be completed exceptionally if query execution fails.
-
singleAsync
Description copied from interface:ResultCursor
Asynchronously return the first record in the result, failing if there is not exactly one record left in the stream.- Specified by:
singleAsync
in interfaceResultCursor
- Returns:
- a
CompletionStage
completed with the first and only record in the stream. Stage will be completed exceptionally withNoSuchRecordException
if there is not exactly one record left in the stream. It can also be completed exceptionally if query execution fails.
-
forEachAsync
Description copied from interface:ResultCursor
Asynchronously apply the givenaction
to every record in the result, yielding a summary of it.- Specified by:
forEachAsync
in interfaceResultCursor
- Parameters:
action
- the function to be applied to every record in the result. Provided function should not block.- Returns:
- a
CompletionStage
completed with a summary for the whole query result. Stage can also be completed exceptionally if query execution or provided function fails.
-
listAsync
Description copied from interface:ResultCursor
Asynchronously retrieve and store the entire result stream. This can be used if you want to iterate over the stream multiple times or to store the whole result for later use.Note that this method can only be used if you know that the query that yielded this result returns a finite stream. Some queries can yield infinite results, in which case calling this method will lead to running out of memory.
Calling this method exhausts the result.
- Specified by:
listAsync
in interfaceResultCursor
- Returns:
- a
CompletionStage
completed with a list of all remaining immutable records. Stage can also be completed exceptionally if query execution fails.
-
listAsync
Description copied from interface:ResultCursor
Asynchronously retrieve and store a projection of the entire result. This can be used if you want to iterate over the stream multiple times or to store the whole result for later use.Note that this method can only be used if you know that the query that yielded this result returns a finite stream. Some queries can yield infinite results, in which case calling this method will lead to running out of memory.
Calling this method exhausts the result.
- Specified by:
listAsync
in interfaceResultCursor
- Type Parameters:
T
- the type of result list elements- Parameters:
mapFunction
- a function to map from Record to T. SeeRecords
for some predefined functions.- Returns:
- a
CompletionStage
completed with a list of all remaining immutable records. Stage can also be completed exceptionally if query execution or provided function fails.
-
isOpenAsync
Description copied from interface:ResultCursor
Determine if result is open.Result is considered to be open if it has not been consumed (
ResultCursor.consumeAsync()
) and its creator object (e.g. session or transaction) has not been closed (including committed or rolled back).Attempts to access data on closed result will produce
ResultConsumedException
.- Specified by:
isOpenAsync
in interfaceResultCursor
- Returns:
- a
CompletionStage
completed withtrue
if result is open andfalse
otherwise.
-
discardAllFailureAsync
Description copied from interface:org.neo4j.driver.internal.FailableCursor
Discarding all unconsumed records and returning failure if there is any pull errors.- Specified by:
discardAllFailureAsync
in interfaceorg.neo4j.driver.internal.FailableCursor
-
pullAllFailureAsync
Description copied from interface:org.neo4j.driver.internal.FailableCursor
Pulling all unconsumed records into memory and returning failure if there is any pull errors.- Specified by:
pullAllFailureAsync
in interfaceorg.neo4j.driver.internal.FailableCursor
-
mapSuccessfulRunCompletionAsync
- Specified by:
mapSuccessfulRunCompletionAsync
in interfaceAsyncResultCursor
-