Method: Redis#xadd
- Defined in:
- lib/redis.rb
#xadd(key, entry, approximate: nil, maxlen: nil, id: '*') ⇒ String
Add new entry to the stream.
2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 |
# File 'lib/redis.rb', line 2975 def xadd(key, entry, approximate: nil, maxlen: nil, id: '*') args = [:xadd, key] if maxlen args << "MAXLEN" args << "~" if approximate args << maxlen end args << id args.concat(entry.to_a.flatten) synchronize { |client| client.call(args) } end |