module Puggernaut class Server class Channel < EM::Channel include Logger attr_reader :channels def initialize(channels) @channels = channels super() end class < 100 @messages[channel_name] = @messages[channel_name][-100..-1] end hash[channel_name] = messages hash end @channels.each do |channel| push = channel.channels.collect do |channel_name| if messages[channel_name] messages[channel_name].collect { |message| "#{channel_name}|#{message.join('|')}" }.join("\n") end end push = push.compact unless push.empty? channel.push push.join("\n") end end end end end end end