/// <summary> /// Tries to read the value(s) under the given key. Used with types that implement /// <see cref="IHasVersionVector"/>. In case of conflict we return all conflicting versions. /// If the key is not found, returns an empty Multiple. /// </summary> public static Multiple <T> TryGetHasVec <T>(this IGossipBackend backend, string key) where T : IHasVersionVector { return(backend.TryGet(key, out Multiple <T> multi) ? multi : default);
/// <summary> /// Tries to read the <see cref="Gossip.Lww{T}"/> value under the given key. If the key is not /// found, returns default. /// </summary> public static Lww <T> TryGetLww <T>(this IGossipBackend backend, string key) { return(backend.TryGet(key, out Lww <T> v) ? v : default);
/// <summary> /// Tries to read the <see cref="IntVersioned{T}"/> value under the given key. If the key is not /// found, returns default. /// </summary> public static IntVersioned <T> TryGetIntVersioned <T>(this IGossipBackend backend, string key) { return(backend.TryGet(key, out IntVersioned <T> v) ? v : default);
/// <summary> /// Tries to read the value(s) under the given key. Can be used with any type - wrapped /// in a <see cref="Gossip.VecVersioned{T}"/> to add a version vector. In case of conflict we return all /// conflicting versions. If the key is not found, returns an empty Multiple. /// </summary> public static Multiple <VecVersioned <T> > TryGetVecVersioned <T>(this IGossipBackend backend, string key) { return(backend.TryGet(key, out Multiple <VecVersioned <T> > multi) ? multi : default);