-
Notifications
You must be signed in to change notification settings - Fork 976
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
Redesign RecordStore
API / interaction
#3035
Comments
@mxinden This issue I mentioned on the community call. There was also a question about splitting |
Yes, I noticed the same thing when trying to implement a persistent record store for iroh. I just had to unwrap the errors to be able to conform to the interface, which is not nice. #3021 is also somewhat related. There is not much point in having a persistent record store for a large number of records if the behaviour pulls it all into one giant |
I would suggest we move forward here and write a first proof-of-concept. Anyone volunteering? |
It's easy to change an interface and alter all usages for it. I could do that. However, adding correct handling for an operation result in some cases could be too invasive in the current architecture. For example - the call of the |
I don't think we should log errors, but instead bubble them up to the user. Why is that not an option? |
Ok. I will create a PR with one operation and show you. |
An alternative approach to the one explored in #3076 is to move the |
That would be a very libp2p way of doing it and consistent with the rest of APIs. |
RecordStore
API / interaction
I have an use case similar to #2024 where a key is updated by several nodes asynchronously and the value-content should converge eventually. Happy to test any implementation that would allow this. |
Description
Currently,
RecordStore
trait returnsResult
only forput
andadd_provider
operations. However, custom implementations (for example DB-based) could return errors on each operation.I wonder whether it's possible to change this trait and add
Result
on each operation to make the trait more consistent with use cases.Motivation
This change will allow handling errors for implementations in an idiomatic way.
Current Implementation
Are you planning to do it yourself in a pull request?
Not this time. This change could affect inner Kademlia error handling.
The text was updated successfully, but these errors were encountered: