Documentation
¶
Overview ¶
Package sessionbatch implements batched session activity updates to reduce SQLite write-lock acquisitions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchUpdater ¶
type BatchUpdater interface {
BatchUpdateSessionActivity(ctx context.Context, tokenHashes []string, now time.Time) error
}
BatchUpdater is the interface for batch session activity updates.
type Batcher ¶
type Batcher struct {
// contains filtered or unexported fields
}
Batcher collects session activity updates and flushes them in batches to reduce SQLite write-lock acquisitions.
func New ¶
func New(ctx context.Context, db BatchUpdater) *Batcher
New creates and starts a Batcher that flushes pending updates every 500ms or when 16 updates accumulate.
Click to show internal directories.
Click to hide internal directories.