Class: Simultaneous::Command::SetPid
- Inherits:
-
CommandBase
- Object
- CommandBase
- Simultaneous::Command::SetPid
- Defined in:
- lib/simultaneous/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
#domain, #domain=, #dump, #merge_params, #namespaced_task_name
Constructor Details
#initialize(task_name, pid) ⇒ SetPid
Returns a new instance of SetPid.
9 10 11 |
# File 'lib/simultaneous/command/set_pid.rb', line 9 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.
7 8 9 |
# File 'lib/simultaneous/command/set_pid.rb', line 7 def pid @pid end |
#task_name ⇒ Object (readonly)
Returns the value of attribute task_name.
7 8 9 |
# File 'lib/simultaneous/command/set_pid.rb', line 7 def task_name @task_name end |
Instance Method Details
#debug ⇒ Object
17 18 19 |
# File 'lib/simultaneous/command/set_pid.rb', line 17 def debug "SetPid :#{namespaced_task_name}: #{@pid}\n" end |
#run ⇒ Object
13 14 15 |
# File 'lib/simultaneous/command/set_pid.rb', line 13 def run Simultaneous::Server.pids[namespaced_task_name] = @pid end |