doc: fully RDoc all methods and classes
[kgio.git] / lib / kgio.rb
blob5de431b2993badf5460d9ca94be32fb1c7552979
1 # -*- encoding: binary -*-
2 require 'socket'
4 # See the {README}[link:index.html]
5 module Kgio
7   # The IPv4 address of UNIX domain sockets, useful for creating
8   # Rack (and CGI) servers that also serve HTTP traffic over
9   # UNIX domain sockets.
10   LOCALHOST = '127.0.0.1'
12   # Kgio::PipeMethods#kgio_tryread and Kgio::SocketMethods#kgio_tryread will
13   # return :wait_readable when waiting for a read is required.
14   WaitReadable = :wait_readable
16   # PipeMethods#kgio_trywrite and SocketMethods#kgio_trywrite will return
17   # :wait_writable when waiting for a read is required.
18   WaitWritable = :wait_writable
19 end
21 require 'kgio_ext'
23 # use Kgio::Pipe.popen and Kgio::Pipe.new instead of IO.popen
24 # and IO.pipe to get PipeMethods#kgio_read and PipeMethod#kgio_write
25 # methods.
26 class Kgio::Pipe < IO
27   include Kgio::PipeMethods
28   class << self
30     # call-seq:
31     #
32     #   rd, wr = Kgio::Pipe.new
33     #
34     # This creates a new pipe(7) with Kgio::Pipe objects that respond
35     # to PipeMethods#kgio_read and PipeMethod#kgio_write
36     alias new pipe
37   end
38 end