Actors with evented IO support
Default size to read from or write to the stream for buffer operations
# File lib/celluloid/io.rb, line 38 def self.copy_stream(src, dst, copy_length = nil, src_offset = nil) raise NotImplementedError, "length/offset not supported" if copy_length || src_offset src, dst = try_convert(src), try_convert(dst) # FIXME: this always goes through the reactor, and can block on file I/O while data = src.read(BLOCK_SIZE) dst << data end end
# File lib/celluloid/io.rb, line 29 def self.evented? actor = Thread.current[:celluloid_actor] actor && actor.mailbox.is_a?(Celluloid::IO::Mailbox) end
# File lib/celluloid/io.rb, line 24 def self.included(klass) klass.send :include, Celluloid klass.mailbox_class Celluloid::IO::Mailbox end
# File lib/celluloid/io.rb, line 34 def self.try_convert(src) ::IO.try_convert(src) end
Generated with the Darkfish Rdoc Generator 2.