arangodb-java-driver
arangodb-java-driver copied to clipboard
It seems that the async client is blocking when consuming a cursor
Is that by design?
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.
👍
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?
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
Fixed by #520, released in https://github.com/arangodb/arangodb-java-driver/releases/tag/v7.2.0