locker

package
v0.0.0-...-04c7352 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2018 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// lock acquire timeout
	// DefaultTimeout lock acquire timeout
	DefaultTimeout = time.Millisecond * 100
)

Variables

This section is empty.

Functions

func New

func New(lockerConfig config.Locker) error

New creates a locker handler from the provided config.Locker and save it in handler for further use

Types

type Interface

type Interface interface {
	Close() error
	Lock(doc object.Interface) (func() error, error)
	TryLock(doc object.Interface, t time.Duration) (func() error, error)
}

Interface is the base functionality that any locker handler should implement in order to become valid handler

func Handler

func Handler() Interface

Handler returns the registered locker handler

Directories

Path Synopsis
handlers

Jump to

Keyboard shortcuts

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