You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the PubsubValueStore assumes Pubsub is distributing a single Key-Value pair which is updating by utilizing a best function that is passed in via the Validator interface.
Given that the PubsubValueStore assumes Get and Put of full data records (as opposed to deltas) it's probably fine to assume that the types of the state and deltas are the same. However, if we wanted we could also add a diff function that takes the states and computes a delta.
Some example merge functions:
Best (as we have now)
Union (if the record type is a set take the union of the set)
BestN (do a union, but only keep the best N records)
Having this (and landing #33) would make an implementation of the suggestion at libp2p/go-libp2p#694 (comment) fairly straightforward.
The text was updated successfully, but these errors were encountered:
Currently the
PubsubValueStore
assumes Pubsub is distributing a single Key-Value pair which is updating by utilizing abest
function that is passed in via theValidator
interface.This looks like:
Instead it would be better to use an interface that allows for:
Given that the
PubsubValueStore
assumesGet
andPut
of full data records (as opposed to deltas) it's probably fine to assume that the types of thestate
anddelta
s are the same. However, if we wanted we could also add adiff
function that takes the states and computes a delta.Some example
merge
functions:Having this (and landing #33) would make an implementation of the suggestion at libp2p/go-libp2p#694 (comment) fairly straightforward.
The text was updated successfully, but these errors were encountered: