ruby - Redis publish in rails 4 stops server thread -


sorry english, i'm newbie.

trying use redis.publish feature rails 4 , redis gem push messages sse.

i have block in controller

logger.info "test1" $redis.publish "user", "test" logger.info "test2" 

where $redis -

$redis = redis.new(:host => '127.0.0.1', :port => 6379, :db => 1,:timeout => 0) 

in initializer.

server console in production print

i, [2013-08-07t22:34:50.138232 #4679]  info -- : test1 

and nothing. request working, thread stops.

by way, $redis.publish "user", "test" @ rails_env=production rails console run , message appear @ client.

can me?

upd: ruby 2.0-p247, rails 4, redis 3.0.4

don't use 1 connection in initializer subscribe , publish both.

i created 2 connections, 1 subscribe in sse writer, 1 in controllers publish, , working normally.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -