WaitForPendingChanges blocks until the change-cache has caught up with the latest writes to the database.
(ctx context.Context)
| 1240 | |
| 1241 | // WaitForPendingChanges blocks until the change-cache has caught up with the latest writes to the database. |
| 1242 | func (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 |