Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrQueueExists = errors.New("queue exists")
ErrQueueExists shows this queue is already registered.
Functions ¶
This section is empty.
Types ¶
type QueueLocker ¶
type QueueLocker interface { Lock(ctx context.Context, key string) error Unlock(ctx context.Context, before time.Time) error }
QueueLocker represents locker interface for suppressing queue duplication.
type Unlocker ¶
type Unlocker struct {
// contains filtered or unexported fields
}
Unlocker removes unused queue_id list periodically.
func NewUnlocker ¶
func NewUnlocker(l QueueLocker, interval time.Duration, opts ...UnlockerOption) (*Unlocker, error)
NewUnlocker creates Unlocker. As default, expire duration is 24 hours.
type UnlockerOption ¶
type UnlockerOption func(*Unlocker)
UnlockerOption is an option for Unlocker.
func ExpireDuration ¶
func ExpireDuration(dur time.Duration) UnlockerOption
ExpireDuration sets expire duration to Unlocker.
Click to show internal directories.
Click to hide internal directories.