-
Notifications
You must be signed in to change notification settings - Fork 6
Conversation
Changes for: libp2p/go-libp2p-routing#21 (also fixes some test issues)
I originally started working on this to try to make using pubsub as a ValueStore reasonable. Unfortunately, I couldn't quite get all of the abstractions in line. However, IMO, this change is still a step in the right direction. |
Changes for: libp2p/go-libp2p-routing#21 (also fixes some test issues)
Agreed on the sentiment that this leaks as an abstraction, but on the same time it can also be useful for users of the DHT. |
Which information, the peers from which we got the values? At the moment, you can use the routing notification system. |
So coming back to the premise, are we sure we won't have any use case that is interested in multiple different values? |
1. Handle key extraction. 2. Take a peer ID instead of a raw hash. 3. Comment that we should consider removing this.
There probably are but the semantics will likely be a bit different:
Basically, we may need a method with this name however, I'd hold off on that until we actually know what the semantics of that method will be. |
|
||
// Expired is an option that tells the routing system to return expired records | ||
// when no newer records are known. | ||
var Expired Option = func(opts *Options) error { |
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.
any particular reason this isnt just:
func Expired(opts *Options) error {
// ....
}
This feels a little weird, and I do like the idea of being able to get multiple values out, but otherwise, this is probably a good step forward |
That's the idea behind the commented out search method. Basically, we'll want something more powerful than "give me K (possibly identical) values from N peers". |
Motivation: According to the documentation/signature, it looks like GetValues
exists to return a bunch of different values from the ValueStore. However:
because we actually want multiple values).
the values).
anything).
This interface change removes GetValues and modifies GetValue to give us
everything we need. I've also left in a commented-out SearchValue method that
I'd like to eventually implement as a "progressive" GetValue (that keeps
returning better and better records).