arangodb-java-driver icon indicating copy to clipboard operation
arangodb-java-driver copied to clipboard

It seems that the async client is blocking when consuming a cursor

Open oridag opened this issue 2 years ago • 4 comments

Is that by design?

oridag avatar May 04 '22 15:05 oridag

You are right, this is unfortunately due to some legacy design decision. To work around it, you can manually create the requests to consume the cursor and execute them by calling http://arangodb.github.io/arangodb-java-driver/javadoc-6_16/com/arangodb/async/ArangoDBAsync.html#execute-com.arangodb.velocystream.Request-

We are currently evaluating the implementation of a new driver which would be based on asynchronous/reactive core and overcome this limitation.

rashtao avatar May 05 '22 10:05 rashtao

👍

oridag avatar May 10 '22 13:05 oridag

So circling back to this, I don't see how that workaround can work out because ArangoCursorAsync doesn't provide access to the first pre-fetched page of results. Am I missing something?

oridag avatar May 29 '22 07:05 oridag

Here is an example showing how to consume a cursor in a non-blocking way using com.arangodb.async.ArangoDBAsync#execute: https://gist.github.com/rashtao/513172e4a001f6f1708ed0cbb3a895bf

rashtao avatar Jun 03 '22 08:06 rashtao

Fixed by #520, released in https://github.com/arangodb/arangodb-java-driver/releases/tag/v7.2.0

rashtao avatar Dec 18 '23 11:12 rashtao