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
Methods in the vertx-simple-arango-client subproject that return query results should handle cursoring, instead of returning a raw SimpleQueryCursorResponse object.
That is, the code should handle the mechanics of Arango HTTP cursors, and hide this from clients.
Here's an example of what the API for this could look like (subject to change obviously):
Example API
// Get a cursor from a method that executes a querySimpleArangoCusor<JsonObject> jsonOrders = client.db().collection("orders").all();
// Or get a cursor that maps to a specific type by providing a mapping function.// This example assumes the Order class provides an Order(JsonObject) constructor.SimpleArangoCursor<Order> orders = client.db().collection("orders").all(Order::new);
// SimpleArangoCursor has a "forEach" method to iterate over all items,// fetching additional results as needed...orders.forEach(order -> processOrder(order));
// ...an "onEnd" method to to detect the end of the results...orders.onEnd(() -> resultHandler.handle(Future.succeededFuture());
// ...and an "onError" to handle errorsorders.onError(t -> resultHandler.handle(Future.failedFuture(t));
// The underlying Arango cursor will be deleted after the last item is // processed by a forEach, or after the first exception occurs.// As a last resort (not to be relied on), the cursor will be deleted// after a set timeout (20 minutes), which can be changed before calling forEach.
The text was updated successfully, but these errors were encountered:
Methods in the
vertx-simple-arango-client
subproject that return query results should handle cursoring, instead of returning a rawSimpleQueryCursorResponse
object.That is, the code should handle the mechanics of Arango HTTP cursors, and hide this from clients.
Here's an example of what the API for this could look like (subject to change obviously):
Example API
The text was updated successfully, but these errors were encountered: