locker

package
v0.0.73 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2018 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtendLock

func ExtendLock(rp *redis.Pool, key string, value string, expiration time.Duration) error

ExtendLock extends our lock expiration by the passed in number of seconds

func GrabLock

func GrabLock(rp *redis.Pool, key string, expiration time.Duration, retry time.Duration) (string, error)

GrabLock grabs the passed in lock from redis in an atomic operation. It returns the lock value if successful. It will retry until the retry period, returning empty string if not acquired in that time.

func ReleaseLock

func ReleaseLock(rp *redis.Pool, key string, value string) error

ReleaseLock releases the passed in lock, returning any error encountered while doing so. It is not considered an error to release a lock that is no longer present

Types

This section is empty.

Jump to

Keyboard shortcuts

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