Documentation
¶
Overview ¶
Package engineguard separates engine writer ordering from reader visibility.
Index ¶
- type Mutex
- func (m *Mutex) EnableSharedWriters()
- func (m *Mutex) Lock()
- func (m *Mutex) LockState()
- func (m *Mutex) LockWriter()
- func (m *Mutex) Publish(fn func())
- func (m *Mutex) RLock()
- func (m *Mutex) RLockWriter()
- func (m *Mutex) RLocker() sync.Locker
- func (m *Mutex) RUnlock()
- func (m *Mutex) RUnlockWriter()
- func (m *Mutex) Revision() (uint64, bool)
- func (m *Mutex) TryLockCatalog() bool
- func (m *Mutex) TryLockWriter() bool
- func (m *Mutex) Unlock()
- func (m *Mutex) UnlockCatalog()
- func (m *Mutex) UnlockState()
- func (m *Mutex) UnlockWriter()
- func (m *Mutex) WithReaders(fn func() error) error
- func (m *Mutex) WithWriters(fn func() error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mutex ¶
type Mutex struct {
// contains filtered or unexported fields
}
Mutex orders engine mutations and atomic reader-visible publication. The zero value is ready to use. Like sync.RWMutex, it must not be copied or locked recursively.
func (*Mutex) EnableSharedWriters ¶ added in v0.53.2
func (m *Mutex) EnableSharedWriters()
EnableSharedWriters installs a lifecycle barrier before concurrent use.
func (*Mutex) Lock ¶
func (m *Mutex) Lock()
Lock acquires catalog ownership, then the writer gate and mutable state.
func (*Mutex) LockState ¶
func (m *Mutex) LockState()
LockState excludes readers without joining the writer gate, for read-side cache updates. Only derived caches independent of staged admission and WAL state may change under this lock.
func (*Mutex) LockWriter ¶
func (m *Mutex) LockWriter()
LockWriter orders ingestion and WAL operations without joining catalog publication.
func (*Mutex) Publish ¶ added in v0.53.2
func (m *Mutex) Publish(fn func())
Publish atomically installs a prepared update under shared writer ownership.
func (*Mutex) RLock ¶
func (m *Mutex) RLock()
RLock acquires a state snapshot without joining the writer gate.
func (*Mutex) RLockWriter ¶ added in v0.53.2
func (m *Mutex) RLockWriter()
RLockWriter pins engine lifetime while independent series prepare updates.
func (*Mutex) RUnlockWriter ¶ added in v0.53.2
func (m *Mutex) RUnlockWriter()
RUnlockWriter releases shared writer ownership.
func (*Mutex) Revision ¶ added in v0.53.0
Revision returns a coherent publication version; exhaustion permanently disables reuse.
func (*Mutex) TryLockCatalog ¶ added in v0.51.0
TryLockCatalog acquires metadata ownership without waiting for writer or state ownership. The caller must release it with Mutex.UnlockCatalog.
func (*Mutex) TryLockWriter ¶ added in v0.50.1
TryLockWriter acquires writer and state ownership if no other writer owns it; it may wait for readers.
func (*Mutex) Unlock ¶
func (m *Mutex) Unlock()
Unlock releases state, writer, and catalog ownership.
func (*Mutex) UnlockCatalog ¶ added in v0.51.0
func (m *Mutex) UnlockCatalog()
UnlockCatalog releases metadata-only ownership.
func (*Mutex) UnlockState ¶
func (m *Mutex) UnlockState()
UnlockState releases a read-side cache update.
func (*Mutex) UnlockWriter ¶
func (m *Mutex) UnlockWriter()
UnlockWriter releases an ingestion or WAL operation.
func (*Mutex) WithReaders ¶
WithReaders temporarily admits readers while retaining exclusive writer ownership. The caller holds writer and state ownership; fn must not mutate reader-visible state or acquire this mutex.
func (*Mutex) WithWriters ¶
WithWriters admits ingestion and readers during catalog I/O, retaining catalog ownership. The caller holds Lock; fn must not mutate engine state or acquire this mutex.