Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdvisoryLockHash ¶
type AdvisoryLockHash struct {
// contains filtered or unexported fields
}
AdvisoryLockHash's job is to produce a pair of keys that'll be used with Postgres advisory lock functions like `pg_advisory_xact_lock`.
Advisory locks all share a single 64-bit number space, so it's technically possible for completely unrelated locks to collide with each other. It's quite unlikely, but this type allows a user to configure a specific 32-bit prefix which they can use to guarantee that no River hash will ever conflict with one from their application. If no prefix is configured, it'll use the entire 64-bit number space.
func NewAdvisoryLockHash ¶
func NewAdvisoryLockHash(configuredPrefix int32) *AdvisoryLockHash
func (*AdvisoryLockHash) Key ¶
func (h *AdvisoryLockHash) Key() int64
Key generates a pair of keys to be passed into Postgres advisory lock functions like `pg_advisory_xact_lock`.
func (*AdvisoryLockHash) Write ¶
func (h *AdvisoryLockHash) Write(data []byte)
Write writes bytes to the underlying hash.