MCPcopy
hub / github.com/bsm/redislock / ObtainMulti

Function ObtainMulti

redislock.go:204–206  ·  view source on GitHub ↗

ObtainMulti is a short-cut for New(...).ObtainMulti(...).

(ctx context.Context, client RedisClient, keys []string, ttl time.Duration, opt *Options)

Source from the content-addressed store, hash-verified

202
203// ObtainMulti is a short-cut for New(...).ObtainMulti(...).
204func ObtainMulti(ctx context.Context, client RedisClient, keys []string, ttl time.Duration, opt *Options) (*Lock, error) {
205 return New(client).ObtainMulti(ctx, keys, ttl, opt)
206}
207
208// Key returns the redis key used by the lock.
209// If the lock hold multiple key, only the first is returned.

Callers 1

TestLock_ObtainMultiFunction · 0.85

Calls 2

NewFunction · 0.85
ObtainMultiMethod · 0.80

Tested by 1

TestLock_ObtainMultiFunction · 0.68