-
Notifications
You must be signed in to change notification settings - Fork 67
add non-channel query iterator method #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
0e7f1bb
to
5dd9e04
Compare
This avoids the use of a channel.
5dd9e04
to
dc3eeed
Compare
@Kubuxu could you help CR this one? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, the 'having to switch back to legacy mode' kinda sucks. Maybe theres a better way of doing that? Not a huge deal though.
Maybe on conversion to legacy we swap out the next function in case the user calls |
@whyrusleeping I confused, what are you getting at. If |
Lets just have |
Okay will do. |
@Kubuxu @whyrusleeping one thing I was unsure of is the handling of the automatic closing in NextSync(). Even if there is not a go process, there might still be something that needs to be closed, for example the leveldb iterator should probably be closed when done to help free up resources. Comments/reviews on this aspect will be appreciated. Also see ipfs/go-ds-leveldb#1 for some context. |
@kevina I'm thinking we should require that the user always call |
@whyrusleeping okay I cleaned up the logic of when legacyResults is used and when close() is called. This still needs testing. |
@kevina sounds good, ping me when you've added more tests then |
@whyrusleeping Unit tests added. I will do a manual integration test tomorrow, but other than that it should be good to go. |
From IRC:
|
e5e9df7
to
83a8d8c
Compare
83a8d8c
to
f5baddf
Compare
|
||
go b.Process.CloseAfterChildren() | ||
|
||
r.legacyResults = b.Results().(*results) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this assertion always safe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes based on the code for ResultBuilder.Results() in the same file.
@whyrusleeping All tests pass when using this version with go-ipfs. I would call this good to go. |
Continuation of #53