MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / newLateSequenceFeed

Method newLateSequenceFeed

db/changes.go:1263–1276  ·  view source on GitHub ↗

Returns a lateSequenceFeed for the channel, used to find late-arriving (previously skipped) sequences that have been sent to the channel cache. The lateSequenceFeed stores the last (late) sequence seen by this particular _changes feed to support continuous changes.

(singleChannelCache SingleChannelCache)

Source from the content-addressed store, hash-verified

1261// skipped) sequences that have been sent to the channel cache. The lateSequenceFeed stores the last (late)
1262// sequence seen by this particular _changes feed to support continuous changes.
1263func (db *DatabaseCollectionWithUser) newLateSequenceFeed(singleChannelCache SingleChannelCache) *lateSequenceFeed {
1264
1265 if !singleChannelCache.SupportsLateFeed() {
1266 return nil
1267 }
1268
1269 lsf := &lateSequenceFeed{
1270 active: true,
1271 lateSequenceUUID: singleChannelCache.LateSequenceUUID(),
1272 channel: singleChannelCache.ChannelID(),
1273 lastSequence: singleChannelCache.RegisterLateSequenceClient(),
1274 }
1275 return lsf
1276}
1277
1278// Feed to process late sequences for the channel. Updates lastSequence as it works the feed. Error indicates
1279// previous position in late sequence feed isn't available, and caller should reset to low sequence.

Callers 1

Calls 4

SupportsLateFeedMethod · 0.65
LateSequenceUUIDMethod · 0.65
ChannelIDMethod · 0.65

Tested by

no test coverage detected