From b85d0253302f68b7f657143c080f8d96c0dbf4b5 Mon Sep 17 00:00:00 2001 From: Bruz Marzolf Date: Wed, 10 Dec 2014 13:03:33 -0800 Subject: [PATCH] Add unix server Based on https://github.com/celluloid/reel/pull/123, which hasn't been merged yet. --- lib/reel.rb | 1 + lib/reel/server/unix.rb | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 lib/reel/server/unix.rb diff --git a/lib/reel.rb b/lib/reel.rb index 627dda4..4646030 100644 --- a/lib/reel.rb +++ b/lib/reel.rb @@ -14,6 +14,7 @@ require 'reel/server' require 'reel/server/http' require 'reel/server/https' +require 'reel/server/unix' require 'reel/websocket' require 'reel/stream' diff --git a/lib/reel/server/unix.rb b/lib/reel/server/unix.rb new file mode 100644 index 0000000..da819f8 --- /dev/null +++ b/lib/reel/server/unix.rb @@ -0,0 +1,18 @@ +module Reel + class Server + class UNIX < Server + + # Create a new Reel HTTPS server + # + # @option options [String] socket path to bind to + # @option options [Fixnum] backlog of requests to accept + # + # @return [Reel::Server::UNIX] Reel UNIX server actor + def initialize(socket_path, options={}, &callback) + server = Celluloid::IO::UNIXServer.new(socket_path) + options[:socket_path] = socket_path + super(server, options, &callback) + end + end + end +end