diff --git a/lib/async/container/notify/server.rb b/lib/async/container/notify/server.rb index 26b55b2..6da975d 100644 --- a/lib/async/container/notify/server.rb +++ b/lib/async/container/notify/server.rb @@ -11,7 +11,6 @@ module Async module Container module Notify class Server - NOTIFY_SOCKET = "NOTIFY_SOCKET" MAXIMUM_MESSAGE_SIZE = 4096 def self.load(message) diff --git a/lib/async/container/process.rb b/lib/async/container/process.rb index b3d235d..9ea189d 100644 --- a/lib/async/container/process.rb +++ b/lib/async/container/process.rb @@ -84,15 +84,13 @@ def self.fork(**options) end end - # def self.spawn(*arguments, name: nil, **options) - # self.new(name: name) do |process| - # unless options.key?(:out) - # options[:out] = process.out - # end - # - # ::Process.spawn(*arguments, **options) - # end - # end + def self.spawn(*arguments, name: nil, **options) + self.new(name: name) do |process| + Notify::Pipe.new(process.out).before_spawn(arguments, options) + + ::Process.spawn(*arguments, **options) + end + end # Initialize the process. # @parameter name [String] The name to use for the child process. @@ -122,6 +120,9 @@ def name= value # @attribute [String] attr :name + # @attribute [Integer] The process identifier. + attr :pid + # A human readable representation of the process. # @returns [String] def inspect