lib/attention/publisher.rb in attention-0.0.3 vs lib/attention/publisher.rb in attention-0.0.4
- old
+ new
@@ -6,11 +6,11 @@
# @param value [Object] The value to publish
# @yield Allows an optional block to use the Redis connection
# @yieldparam redis [Redis] The Redis connection
def publish(channel, value)
redis = Attention.redis.call
- redis.publish channel, payload_for(value)
yield redis if block_given?
+ redis.publish channel, payload_for(value)
end
# Converts published values to JSON if possible
# @api private
def payload_for(value)