Method: Cosmos::Store#write_topic
- Defined in:
- lib/cosmos/utilities/store_autoload.rb
#write_topic(topic, msg_hash, id = '*', maxlen = nil, approximate = true) ⇒ String
Add new entry to the redis stream. > www.rubydoc.info/github/redis/redis-rb/Redis:xadd
194 195 196 197 198 199 200 |
# File 'lib/cosmos/utilities/store_autoload.rb', line 194 def write_topic(topic, msg_hash, id = '*', maxlen = nil, approximate = true) id = '*' if id.nil? # Logger.debug "write_topic topic:#{topic} id:#{id} hash:#{msg_hash}" @redis_pool.with do |redis| return redis.xadd(topic, msg_hash, id: id, maxlen: maxlen, approximate: approximate) end end |