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

Method WaitForPendingChanges

db/changes.go:1242–1249  ·  view source on GitHub ↗

WaitForPendingChanges blocks until the change-cache has caught up with the latest writes to the database.

(ctx context.Context)

Source from the content-addressed store, hash-verified

1240
1241// WaitForPendingChanges blocks until the change-cache has caught up with the latest writes to the database.
1242func (c *DatabaseCollection) WaitForPendingChanges(ctx context.Context) error {
1243 lastSequence, err := c.LastSequence(ctx)
1244 if err != nil {
1245 return err
1246 }
1247 base.DebugfCtx(ctx, base.KeyChanges, "Waiting for sequence: %d", lastSequence)
1248 return c.changeCache().waitForSequence(ctx, lastSequence, base.DefaultWaitForSequence)
1249}
1250
1251// Late Sequence Feed
1252// Manages the changes feed interaction with a channels cache's set of late-arriving entries

Calls 4

LastSequenceMethod · 0.95
changeCacheMethod · 0.95
DebugfCtxFunction · 0.92
waitForSequenceMethod · 0.80