def start
@messages = Queue.new
@message_consumer = Thread.new do
loop do
meths = @messages.pop
begin
meths.each { |meth, args| broadcast_sync meth, *args }
rescue
options[:logger].error $!
end
end
end
@socket = connect
username = @options[:user]
username ||= @nick
realname = @options[:name]
realname ||= @nick
pass @options[:server_password] if @options[:server_password]
user username, @nick, @nick, realname
nick @nick
while line = @socket.gets
meths = receive line
@messages.push meths
meths.each { |meth, args| broadcast meth, *args }
end
end