Module: Async::IO
- Defined in:
- lib/async/io.rb,
lib/async/io/peer.rb,
lib/async/io/trap.rb,
lib/async/io/buffer.rb,
lib/async/io/server.rb,
lib/async/io/socket.rb,
lib/async/io/stream.rb,
lib/async/io/address.rb,
lib/async/io/generic.rb,
lib/async/io/threads.rb,
lib/async/io/version.rb,
lib/async/io/endpoint.rb,
lib/async/io/standard.rb,
lib/async/io/ssl_socket.rb,
lib/async/io/tcp_socket.rb,
lib/async/io/udp_socket.rb,
lib/async/io/unix_socket.rb,
lib/async/io/notification.rb,
lib/async/io/ssl_endpoint.rb,
lib/async/io/binary_string.rb,
lib/async/io/endpoint/each.rb,
lib/async/io/host_endpoint.rb,
lib/async/io/protocol/line.rb,
lib/async/io/unix_endpoint.rb,
lib/async/io/shared_endpoint.rb,
lib/async/io/socket_endpoint.rb,
lib/async/io/address_endpoint.rb,
lib/async/io/protocol/generic.rb,
lib/async/io/composite_endpoint.rb
Defined Under Namespace
Modules: Peer, Protocol, Server Classes: AddressEndpoint, BasicSocket, Buffer, CompositeEndpoint, Endpoint, Generic, HostEndpoint, IPSocket, Notification, SSLEndpoint, SSLServer, SSLSocket, SharedEndpoint, Socket, SocketEndpoint, StandardError, StandardInput, StandardOutput, Stream, TCPServer, TCPSocket, Threads, Trap, UDPSocket, UNIXEndpoint, UNIXServer, UNIXSocket
Constant Summary collapse
- Address =
Addrinfo
- BLOCK_SIZE =
The default block size for IO buffers. Defaults to 64KB (typical pipe buffer size).
ENV.fetch('ASYNC_IO_BLOCK_SIZE', 1024*64).to_i
- MAXIMUM_READ_SIZE =
The maximum read size when appending to IO buffers. Defaults to 8MB.
ENV.fetch('ASYNC_IO_MAXIMUM_READ_SIZE', BLOCK_SIZE * 128).to_i
- VERSION =
"1.43.2"
- STDIN =
StandardInput.new
- STDOUT =
StandardOutput.new
- STDERR =
StandardError.new
- SSLError =
OpenSSL::SSL::SSLError
- SecureEndpoint =
Backwards compatibility.
SSLEndpoint
- BinaryString =
This is deprecated.
Buffer
Class Method Summary collapse
- .buffer? ⇒ Boolean
- .file_descriptor_limit ⇒ Object
- .pipe ⇒ Object
-
.try_convert(io, &block) ⇒ Object
Convert a Ruby ::IO object to a wrapped instance:.
Class Method Details
.buffer? ⇒ Boolean
22 23 24 |
# File 'lib/async/io.rb', line 22 def self.buffer? ::IO.const_defined?(:Buffer) end |
.file_descriptor_limit ⇒ Object
18 19 20 |
# File 'lib/async/io.rb', line 18 def self.file_descriptor_limit Process.getrlimit(Process::RLIMIT_NOFILE).first end |
.pipe ⇒ Object
28 29 30 |
# File 'lib/async/io/generic.rb', line 28 def self.pipe ::IO.pipe.map(&Generic.method(:new)) end |
.try_convert(io, &block) ⇒ Object
Convert a Ruby ::IO object to a wrapped instance:
20 21 22 23 24 25 26 |
# File 'lib/async/io/generic.rb', line 20 def self.try_convert(io, &block) if wrapper_class = Generic::WRAPPERS[io.class] wrapper_class.new(io, &block) else raise ArgumentError.new("Unsure how to wrap #{io.class}!") end end |