Class: Celluloid::IO::UNIXServer

Inherits:
Object
  • Object
show all
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

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

#acceptObject


18
19
20
21
# File 'lib/celluloid/io/unix_server.rb', line 18

def accept
  Celluloid::IO.wait_readable(@server)
  accept_nonblock
end

#accept_nonblockObject


23
24
25
# File 'lib/celluloid/io/unix_server.rb', line 23

def accept_nonblock
  Celluloid::IO::UNIXSocket.new(@server.accept_nonblock)
end

#to_ioObject


27
28
29
# File 'lib/celluloid/io/unix_server.rb', line 27

def to_io
  @server
end