Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我们知道我们可以使用谓词从 EventStore 中获取事件。它包含开始日期和结束日期。使用它来获取属于该时间段的所有事件。
但是,我正在寻找可以让我从事件存储中仅获取特定数量的事件的东西 - 例如:从事件存储中获取前 100 个事件。有可能吗?
使用 enumerateEventsMatchingPredicate:withBlock: 方法。每次执行块时增加一个计数器,当达到限制时,将 stop 指向的值更改为 YES。每次执行块时,也会将事件添加到可变集合中。