我建立了一套简单的接口和一个类别,使我能够以普通字典出版项目的增量和清除量。 登记员在签字时收到全部名单,此后只得到改动。
尽管我的解决办法是行之有效的,但我正在寻找一些标准稍微提高的东西,而这种标准几乎没有本土。 你们是否有任何建议?
www.un.org/Depts/DGACM/index_spanish.htm 关于我迄今发现的情况的说明:
我一直在研究Microsoft的追溯延伸。 根据Joon Skeet的“LINQ to Rx: second mys” ***,他说,“观察者一旦签字,即可按顺序(在不同的路面上,在违约时)公布所有材料。 单独要求登记在多个时间序列上的可观测性 这种说法像基本想法一样,但我找不到任何具体的例子,我并不真正相信“目标”或“AsyncSubject”的表面安全。
www.un.org/Depts/DGACM/index_spanish.htm 关于我的本土解决办法的说明:
提供给用户的结构类似:
/// <summary>
/// Interface for a set of changes that are being published.
/// </summary>
/// <typeparam name="TKey"></typeparam>
/// <typeparam name="TItem"></typeparam>
public interface IPublication<TKey, TItem>
{
/// <summary>
/// Version of the list.
/// </summary>
long Version { get; }
/// <summary>
/// Items that were added or updated.
/// </summary>
IEnumerable<TItem> ChangedItems { get; }
/// <summary>
/// Keys to items that were removed.
/// </summary>
IEnumerable<TKey> RemovedKeys { get; }
}
用户本身必须实施这一接口:
/// <summary>
/// Interface for a subscriber that will receive IPublication{TKey, TItem} deliveries from a publisher.
/// </summary>
/// <typeparam name="TKey"></typeparam>
/// <typeparam name="TItem"></typeparam>
public interface ISubscribe<TKey, TItem>
{
void Deliver(IPublication<TKey, TItem> pub);
}
当然,我的普通字典出版商有这一方法:
/// <summary>
/// Adds the give subscriber to the list of subscribers and immediately publishes the
/// dictionary contents to the new subscriber. The return value may be disposed when
/// the subscriber wishes to terminate it s subscription.
/// </summary>
/// <param name="subscriber"></param>
/// <returns></returns>
public IDisposable Subscribe(ISubscribe<TKey, TItem> subscriber);
[1] https://codeblog.jonskeet.uk/2010/01/19/linq-to-rx-second-impressions/