Class: FireAndForget::Command::SetPid
- Inherits:
-
CommandBase
- Object
- CommandBase
- FireAndForget::Command::SetPid
- Defined in:
- lib/fire_and_forget/command/set_pid.rb
Instance Attribute Summary collapse
-
#pid ⇒ Object
readonly
Returns the value of attribute pid.
-
#task_name ⇒ Object
readonly
Returns the value of attribute task_name.
Attributes inherited from CommandBase
Instance Method Summary collapse
- #debug ⇒ Object
-
#initialize(task_name, pid) ⇒ SetPid
constructor
A new instance of SetPid.
- #run ⇒ Object
Methods inherited from CommandBase
Constructor Details
#initialize(task_name, pid) ⇒ SetPid
Returns a new instance of SetPid.
7 8 9 |
# File 'lib/fire_and_forget/command/set_pid.rb', line 7 def initialize(task_name, pid) @task_name, @pid = task_name.to_sym, pid.to_i end |
Instance Attribute Details
#pid ⇒ Object (readonly)
Returns the value of attribute pid.
5 6 7 |
# File 'lib/fire_and_forget/command/set_pid.rb', line 5 def pid @pid end |
#task_name ⇒ Object (readonly)
Returns the value of attribute task_name.
5 6 7 |
# File 'lib/fire_and_forget/command/set_pid.rb', line 5 def task_name @task_name end |
Instance Method Details
#debug ⇒ Object
15 16 17 |
# File 'lib/fire_and_forget/command/set_pid.rb', line 15 def debug "SetPid :#{@task_name}: #{@pid}\n" end |
#run ⇒ Object
11 12 13 |
# File 'lib/fire_and_forget/command/set_pid.rb', line 11 def run FireAndForget::Server.pids[@task_name] = @pid end |