Class: Celluloid::IO::UNIXServer
- Inherits:
-
Object
- Object
- Celluloid::IO::UNIXServer
- Extended by:
- Forwardable
- Defined in:
- lib/celluloid/io/unix_server.rb
Overview
UNIXServer with combined blocking and evented support
Class Method Summary collapse
Instance Method Summary collapse
- #accept ⇒ Object
- #accept_nonblock ⇒ Object
-
#initialize(socket_path) ⇒ UNIXServer
constructor
A new instance of UNIXServer.
- #to_io ⇒ Object
Constructor Details
#initialize(socket_path) ⇒ UNIXServer
Returns a new instance of UNIXServer.
14 15 16 |
# File 'lib/celluloid/io/unix_server.rb', line 14 def initialize(socket_path) @server = ::UNIXServer.new(socket_path) end |
Class Method Details
.open(socket_path) ⇒ Object
10 11 12 |
# File 'lib/celluloid/io/unix_server.rb', line 10 def self.open(socket_path) self.new(socket_path) end |
Instance Method Details
#accept ⇒ Object
18 19 20 21 |
# File 'lib/celluloid/io/unix_server.rb', line 18 def accept Celluloid::IO.wait_readable(@server) accept_nonblock end |
#accept_nonblock ⇒ Object
23 24 25 |
# File 'lib/celluloid/io/unix_server.rb', line 23 def accept_nonblock Celluloid::IO::UNIXSocket.new(@server.accept_nonblock) end |
#to_io ⇒ Object
27 28 29 |
# File 'lib/celluloid/io/unix_server.rb', line 27 def to_io @server end |