Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AcquireScript = redis.NewScript(`
local prev = redis.call("SETBIT", KEYS[1], ARGV[1], 1)
if prev == 1 then
return 0
end
if tonumber(ARGV[2]) > 0 then
local ttl = redis.call("TTL", KEYS[1])
if ttl < 0 then
redis.call("EXPIRE", KEYS[1], ARGV[2])
end
end
return 1
`)
Functions ¶
This section is empty.
Types ¶
type LockRequest ¶
type Request ¶
type Request struct {
Usecase string // Unique identifier for the usecase (example: "send_email")
Target string // Target resource or entity to lock (example: "user:123", "2026-03-04")
TTL time.Duration // Time-to-live for the lock in seconds (default: 60)
}
Lock Request
type Scheduler ¶
func NewScheduler ¶
func (*Scheduler) Schedule ¶
func (s *Scheduler) Schedule(params SchedulerRequest) error
Click to show internal directories.
Click to hide internal directories.