Module: StartHer::Publisher
Instance Method Summary collapse
Methods included from RedisClient
Methods included from RetryPolicies
Instance Method Details
#publish(channel, message) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/start_her/publisher.rb', line 6 def publish(channel, ) exponential_backoff({}, ::Redis::BaseConnectionError) do client.publish(channel, .to_msgpack) end rescue => e StartHer.logger.error e raise e end |
#reliable_publish(channel, message) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/start_her/publisher.rb', line 15 def reliable_publish(channel, ) exponential_backoff({}, ::Redis::BaseConnectionError) do client.multi do |multi| backlog_ttl(channel) multi.lpush(channel.to_current_backlog, .to_msgpack) multi.publish(channel, .to_msgpack) end end rescue => e StartHer.logger.error e raise e end |