lib/plezi/common/redis.rb in plezi-0.11.2 vs lib/plezi/common/redis.rb in plezi-0.12.0

- old
+ new

@@ -22,30 +22,34 @@ begin data = YAML.safe_load(msg, safe_types) next if data[:server] == Plezi::Settings.uuid data[:type] = Object.const_get(data[:type]) unless data[:type].nil? || data[:type] == :all if data[:target] - GRHttp::Base::WSHandler.unicast data[:target], data + data[:type].___faild_unicast( data ) unless Iodine::Http::Websockets.unicast data[:target], data else - GRHttp::Base::WSHandler.broadcast data + Iodine::Http::Websockets.broadcast data end rescue => e - GReactor.error "The following could be a security breach attempt:" - GReactor.error e + Iodine.error "The following could be a security breach attempt:" + Iodine.error e end end end rescue => e - GReactor.error e + Iodine.error e retry end end @redis end end def get_redis return @redis if (@redis_sub_thread && @redis_sub_thread.alive?) && @redis inner_init_redis + end + def away? server + return true unless get_redis + @redis.pubsub('CHANNELS', server).empty? end end end module_function