You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: driver/src/main/java/org/neo4j/driver/reactive/RxStatementResult.java
+15-13Lines changed: 15 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,8 @@
22
22
importorg.reactivestreams.Subscriber;
23
23
importorg.reactivestreams.Subscription;
24
24
25
+
importjava.util.List;
26
+
25
27
importorg.neo4j.driver.Record;
26
28
importorg.neo4j.driver.Statement;
27
29
importorg.neo4j.driver.summary.ResultSummary;
@@ -43,11 +45,11 @@ public interface RxStatementResult
43
45
/**
44
46
* Returns a cold publisher of keys.
45
47
* <p>
46
-
* When this publisher is {@linkplain Publisher#subscribe(Subscriber) subscribed}, the query statement is sent to the server and executed.
47
-
* This method does not start the record streaming nor publish query execution error.
48
+
* When this publisher is {@linkplain Publisher#subscribe(Subscriber) subscribed}, the statement is sent to the server and executed.
49
+
* This method does not start the record streaming nor publish statement execution result.
48
50
* To retrieve the execution result, either {@link #records()} or {@link #summary()} can be used.
49
-
* {@link #records()} starts record streaming and reports query execution error.
50
-
* {@link #summary()} skips record streaming and directly reports query execution error.
51
+
* {@link #records()} starts record streaming and reports statement execution result.
52
+
* {@link #summary()} skips record streaming and directly reports statement execution result.
51
53
* <p>
52
54
* Consuming of execution result ensures the resources (such as network connections) used by this result is freed correctly.
53
55
* Consuming the keys without consuming the execution result will result in resource leak.
@@ -59,23 +61,23 @@ public interface RxStatementResult
59
61
* then the buffered keys will be returned.
60
62
* @return a cold publisher of keys.
61
63
*/
62
-
Publisher<String> keys();
64
+
Publisher<List<String>> keys();
63
65
64
66
/**
65
67
* Returns a cold unicast publisher of records.
66
68
* <p>
67
69
* When the record publisher is {@linkplain Publisher#subscribe(Subscriber) subscribed},
68
-
* the query statement is executed and the query result is streamed back as a record stream followed by a result summary.
70
+
* the query statement is executed and the statement result is streamed back as a record stream followed by a result summary.
69
71
* This record publisher publishes all records in the result and signals the completion.
70
72
* However before completion or error reporting if any, a cleanup of result resources such as network connection will be carried out automatically.
71
73
* <p>
72
74
* Therefore the {@link Subscriber} of this record publisher shall wait for the termination signal (complete or error)
73
75
* to ensure that the resources used by this result are released correctly.
74
-
* Then the session is ready to be used to run more queries.
76
+
* Then the session is ready to be used to run more statements.
75
77
* <p>
76
78
* Cancelling of the record streaming will immediately terminate the propagation of new records.
77
-
* But it will not cancel the query execution.
78
-
* As a result, a termination signal (complete or error) will still be sent to the {@link Subscriber} after the query execution is finished.
79
+
* But it will not cancel statement execution on the server.
80
+
* When the execution is finished, the {@link Subscriber} will be notified with a termination signal (complete or error).
79
81
* <p>
80
82
* The record publishing event by default runs in an Network IO thread, as a result no blocking operation is allowed in this thread.
81
83
* Otherwise network IO might be blocked by application logic.
@@ -92,12 +94,12 @@ public interface RxStatementResult
92
94
/**
93
95
* Returns a cold publisher of result summary which arrives after all records.
94
96
* <p>
95
-
* {@linkplain Publisher#subscribe(Subscriber) Subscribing} the summary publisher results in the execution of the query followed by the result summary returned.
96
-
* The summary publisher cancels record publishing if not yet subscribed and directly streams back the summary on query execution completion.
97
+
* {@linkplain Publisher#subscribe(Subscriber) Subscribing} the summary publisher results in the execution of the statement followed by the result summary being returned.
98
+
* The summary publisher cancels record publishing if not yet subscribed and directly streams back the summary on statement execution completion.
97
99
* As a result, the invocation of {@link #records()} after this method, would receive an empty publisher.
98
100
* <p>
99
-
* If subscribed after {@link #keys()}, then the result summary will be published after the query execution without streaming any record to client.
100
-
* If subscribed after {@link #records()}, then the result summary will be published after the query execution and the streaming of records.
101
+
* If subscribed after {@link #keys()}, then the result summary will be published after the statement execution without streaming any record to client.
102
+
* If subscribed after {@link #records()}, then the result summary will be published after the statement execution and the streaming of records.
101
103
* <p>
102
104
* Usually, this method shall be chained after {@link #records()} to ensure that all records are processed before summary.
0 commit comments