class FastIRC::Reader

Overview

Reads an IO stream and outputs a stream of Message objects.

TODO use a circular buffer to reduce memory copies?

Defined in:

fast_irc/reader.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(io : IO, strict : Bool = false) #

Creates a new Reader which reads from io. When strict is set, it will be passed to FastIRC.parse_line.


[View source]

Instance Method Detail

def next : Message | Nil #

Reads the next IRC message from the IO, or returns nil on EOF.

irc_reader = FastIRC::Reader.new(io)
while message = irc_reader.next
  message.command # => "PRIVMSG" : String
end

[View source]