Skip to content
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

Add GetValuesAsync function #47

Closed
mildred opened this issue Feb 8, 2017 · 7 comments
Closed

Add GetValuesAsync function #47

mildred opened this issue Feb 8, 2017 · 7 comments

Comments

@mildred
Copy link

mildred commented Feb 8, 2017

Just like there is FindPeersAsync, there should be a function to lookup a value in the DHT asynchronously, GetValuesAsync. With no maximum number of records (just a cancellable context) and a channel to get the results.

@whyrusleeping
Copy link
Contributor

I think this is a pretty good idea, We should probably just change the current GetValues to return a channel instead of a slice, and then give it logic to treat nvals < 0 as infinite

@mildred
Copy link
Author

mildred commented Feb 22, 2017

I have a patch for this ... on top of gx/ipfs/QmRG9fdibExi5DFy8kzyxF76jvZVUb2mQBUSMNP1YaYn9M/go-libp2p-kad-dht. It keeps the current GetValues and add a GetValuesAsync that returns a channel for results

See: https://gist.github.com/mildred/19be643f54e84e31220627183f508620

@mildred
Copy link
Author

mildred commented Feb 22, 2017

error management is different in async mode. It may be that not everyone would want to convert to async because of that.

mildred added a commit to mildred/ipfs-objects that referenced this issue Feb 22, 2017
@mildred
Copy link
Author

mildred commented Feb 22, 2017

Here are the commits for all the locations that needs change:

@whyrusleeping
Copy link
Contributor

@mildred Go ahead and PR the dht changes into here, @Kubuxu and I will review them that way

@mildred
Copy link
Author

mildred commented Feb 22, 2017

Just created the PR

@whyrusleeping whyrusleeping added the status/deferred Conscious decision to pause or backlog label Oct 17, 2017
@bigs
Copy link
Contributor

bigs commented Sep 11, 2018

change was made via SearchValues

@bigs bigs closed this as completed Sep 11, 2018
@ghost ghost removed the status/deferred Conscious decision to pause or backlog label Sep 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants