Class: Rundoc::CodeCommand::Background::WaitRunner

Inherits:
Object
  • Object
show all
Defined in:
lib/rundoc/code_command/background/wait.rb

Instance Method Summary collapse

Constructor Details

#initialize(user_args:, render_command:, render_result:, io: nil, contents: nil) ⇒ WaitRunner

Returns a new instance of WaitRunner.



15
16
17
18
19
20
# File 'lib/rundoc/code_command/background/wait.rb', line 15

def initialize(user_args:, render_command:, render_result:, io: nil, contents: nil)
  @name = user_args.name
  @wait = user_args.wait
  @timeout_value = user_args.timeout
  @background = nil
end

Instance Method Details

#backgroundObject



22
23
24
# File 'lib/rundoc/code_command/background/wait.rb', line 22

def background
  @background ||= Rundoc::CodeCommand::Background::ProcessSpawn.find(@name)
end

#call(env = {}) ⇒ Object



30
31
32
33
# File 'lib/rundoc/code_command/background/wait.rb', line 30

def call(env = {})
  background.wait(@wait, @timeout_value)
  ""
end

#to_md(env = {}) ⇒ Object



26
27
28
# File 'lib/rundoc/code_command/background/wait.rb', line 26

def to_md(env = {})
  ""
end