[ 
https://issues.apache.org/jira/browse/TINKERPOP-3243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18089768#comment-18089768
 ] 

ASF GitHub Bot commented on TINKERPOP-3243:
-------------------------------------------

kenhuuu commented on code in PR #3463:
URL: https://github.com/apache/tinkerpop/pull/3463#discussion_r3431541538


##########
gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.js:
##########
@@ -94,12 +94,32 @@ class Traversal {
   }
 
   /**
-   * Async iterator method implementation.
-   * Returns a promise containing an iterator item.
-   * @returns {Promise.<{value, done}>}
+   * Returns the next result from the traversal.
+   *
+   * When called without an argument, returns a Promise that resolves to an 
iterator

Review Comment:
   What should `next(1)` do? Single item or array?





> Add next(n) batch iteration to gremlin-javascript
> -------------------------------------------------
>
>                 Key: TINKERPOP-3243
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-3243
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: driver
>    Affects Versions: 3.7.5, 3.8.1
>            Reporter: Taylor Riggan
>            Priority: Minor
>
> The Java, Python, and .NET GLVs all support `next\(n\)` on Traversal to 
> retrieve multiple results at once, but gremlin-javascript only supports 
> single-item `next()` returning `\{value, done}`. This creates an API 
> inconsistency across GLVs that makes it harder to write portable examples and 
> documentation.      
> Currently, users must manually collect results in a loop to achieve batch 
> iteration. A `next(amount)` method returning a `Promise<Array>` would bring 
> gremlin-javascript in line with the other GLVs.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to