Returns all of the cached entries for sequences greater than 'since' in the given channel. Entries are returned in increasing-sequence order.
(options ChangesOptions)
| 320 | // Returns all of the cached entries for sequences greater than 'since' in the given channel. |
| 321 | // Entries are returned in increasing-sequence order. |
| 322 | func (c *singleChannelCacheImpl) GetCachedChanges(options ChangesOptions) (validFrom uint64, result []*LogEntry) { |
| 323 | c.lock.RLock() |
| 324 | defer c.lock.RUnlock() |
| 325 | c.recentlyUsed.Set(true) |
| 326 | sinceSeq := options.Since.SafeSequence() |
| 327 | limit := options.Limit |
| 328 | |
| 329 | // If the activeOnly option is set, then do not limit the number of entries returned |
| 330 | // we don't know how many non active entries will be discarded from the entry set |
| 331 | // by the caller, so the additional entries may be needed to return up to the limit requested |
| 332 | if options.ActiveOnly { |
| 333 | limit = 0 |
| 334 | } |
| 335 | |
| 336 | return c._getCachedChanges(sinceSeq, limit) |
| 337 | } |
| 338 | |
| 339 | func (c *singleChannelCacheImpl) _getCachedChanges(sinceSeq uint64, limit int) (validFrom uint64, result []*LogEntry) { |
| 340 | // Find the first entry in the log to return: |
no test coverage detected