Split the bindings for TSQuery and TSQueryCursor into multiple classes #70
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #66
Separation of Query and QueryCursor while still supporting predicates and without breaking API changes. The new QueryCursor class can be used to evaluate the same Query instance on different nodes in parallel. Also it allows to compile a certain query only once if it is used multiple times.
This also fixes a potential bug 1 that appeared if one did not directly consume the Stream returned from
Query::findMatches
by preloading the entire stream content.The QueryCursor class is still missing bindings for
ts_query_cursor_next_capture
(c.f. API) but this can be added in a future PR.Note: The branch also contains the commits from #63
Footnotes
var s1 = query.findMatches(n1); var s2 = query.findMatches(n2); Stream.concat(s1,s2).forEach(...) ↩