Documentation
¶
Overview ¶
Package pglock holds Postgres session advisory locks on dedicated connections, so the holder's work may use every connection of its pool.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Acquire ¶
func Acquire(ctx context.Context, pool *pgxpool.Pool, key string, wait bool) (release func(), ok bool, err error)
Acquire locks key on a new connection configured like pool's. Without wait it returns ok=false while another session holds key. release closes the connection, which ends the lock.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.