Class: Perfm::PidStore
- Inherits:
-
Object
- Object
- Perfm::PidStore
- Includes:
- Singleton
- Defined in:
- lib/perfm/pid_store.rb
Instance Method Summary collapse
- #add_worker_pid(pid) ⇒ Object
- #clear ⇒ Object
- #get_first_worker_pid ⇒ Object
-
#initialize ⇒ PidStore
constructor
A new instance of PidStore.
Constructor Details
#initialize ⇒ PidStore
Returns a new instance of PidStore.
10 11 12 |
# File 'lib/perfm/pid_store.rb', line 10 def initialize @worker_pids = Concurrent::Array.new end |
Instance Method Details
#add_worker_pid(pid) ⇒ Object
14 15 16 |
# File 'lib/perfm/pid_store.rb', line 14 def add_worker_pid(pid) @worker_pids << pid end |
#clear ⇒ Object
22 23 24 |
# File 'lib/perfm/pid_store.rb', line 22 def clear @worker_pids.clear end |
#get_first_worker_pid ⇒ Object
18 19 20 |
# File 'lib/perfm/pid_store.rb', line 18 def get_first_worker_pid @worker_pids.sample end |