module Redis::Commands::Streams
def xclaim(key, group, consumer, min_idle_time, *ids, **opts)
-
(Array
- the entry ids successfully claimed if justid option is `true`) -
(Hash{String => Hash})
- the entries successfully claimed
Options Hash:
(**opts)
-
:justid
(Boolean
) -- whether to fetch just an array of entry ids or not -
:force
(Boolean
) -- whether to create the pending entry to the pending entries list or not -
:retrycount
(Integer
) -- the number of retry counter -
:time
(Integer
) -- the number of milliseconds as a specific Unix Epoch time -
:idle
(Integer
) -- the number of milliseconds as last time it was delivered of the entry
Parameters:
-
opts
(Hash
) -- several options for `XCLAIM` command -
ids
(Array
) -- one or multiple entry ids -
min_idle_time
(Integer
) -- the number of milliseconds -
consumer
(String
) -- the consumer name -
group
(String
) -- the consumer group name -
key
(String
) -- the stream key
Other tags:
- Example: With justid option -
Example: With force option -
Example: With retrycount option -
Example: With time option -
Example: With idle option -
Example: With arrayed entry ids -
Example: With splatted entry ids -
def xclaim(key, group, consumer, min_idle_time, *ids, **opts) args = [:xclaim, key, group, consumer, min_idle_time].concat(ids.flatten) args.concat(['IDLE', opts[:idle].to_i]) if opts[:idle] args.concat(['TIME', opts[:time].to_i]) if opts[:time] args.concat(['RETRYCOUNT', opts[:retrycount]]) if opts[:retrycount] args << 'FORCE' if opts[:force] args << 'JUSTID' if opts[:justid] blk = opts[:justid] ? Noop : HashifyStreamEntries send_command(args, &blk) end