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
Motivation
----------
The SDK automatically handles backpressure
using `autoRead` settings at the Netty layer,
so users don't need to worry about backpressure
when using the Reactive Query/Search/Analytics API.
This query will stream all rows as they become available from the server. If you want to manually control the data flow (which is important if you are streaming a lot of rows which could cause a potential out of memory situation) you can do this by using explicit `request()` calls.
In this example we initially request a batch size of 10 rows (so streaming can begin).
201
-
Then as each row gets streamed it is written to a `process()` method which does whatever it needs to do to process.
202
-
Then a counter is decremented, and once all of the 10 outstanding rows are processed another batch is loaded.
203
-
Please note that with reactive code, if your `process()` method equivalent is blocking, you *must* move it onto another scheduler so that the I/O threads are not stalled.
204
-
We always recommend not blocking in the first place in reactive code.
193
+
This query will stream all rows as they become available from the server, automatically applying backpressure as necessary.
This Search query will stream all rows as they become available form the server.
307
-
If you want to manually control the data flow (which is important if you are streaming a lot of rows which could cause a potential out of memory situation) you can do this by using explicit `request()` calls.
In this example we initially request a batch size of 10 rows (so streaming can begin).
315
-
Then as each row gets streamed it is written to a `process()` method which does whatever it needs to do to process.
316
-
Then a counter is decremented, and once all of the 10 outstanding rows are processed another batch is loaded.
317
-
Please note that with reactive code, if your `process()` method equivalent is blocking, you *must* move it onto another scheduler so that the I/O threads are not stalled.
318
-
We always recommend not blocking in the first place in reactive code.
306
+
This Search query will stream all rows as they become available from the server, automatically applying backpressure as necessary.
This query will stream all rows as they become available form the server.
242
-
If you want to manually control the data flow (which is important if you are streaming a lot of rows which could cause a potential out of memory situation) you can do this by using explicit `request()` calls.
In this example we initially request a batch size of 10 rows (so streaming can begin).
250
-
Then as each row gets streamed it is written to a `process()` method which does whatever it needs to do to process.
251
-
Then a counter is decremented and once all of the 10 outstanding rows are processed another batch is loaded.
252
-
Please note that if your `process()` method equivalent is blocking, like always with reactive code, you *must* move it onto another scheduler so that the I/O threads are not stalled.
253
-
As always we recommend not blocking in the first place in reactive code.
241
+
This query will stream all rows as they become available from the server, automatically applying backpressure as necessary.
0 commit comments