pglock

package
v0.58.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2026 License: MIT Imports: 4 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL