class FastIRC::Reader
- FastIRC::Reader
- Reference
- Object
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.crConstructors
-
.new(io : IO, strict : Bool = false)
Creates a new
Reader
which reads from io.
Instance Method Summary
-
#next : Message | Nil
Reads the next IRC message from the IO, or returns nil on EOF.
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
.
Instance Method Detail
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