Skip to content

Commit

Permalink
Expose Process#spawn.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Dec 23, 2024
1 parent 687a394 commit 990f2d3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
1 change: 0 additions & 1 deletion lib/async/container/notify/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ module Async
module Container
module Notify
class Server
NOTIFY_SOCKET = "NOTIFY_SOCKET"
MAXIMUM_MESSAGE_SIZE = 4096

def self.load(message)
Expand Down
19 changes: 10 additions & 9 deletions lib/async/container/process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 990f2d3

Please sign in to comment.