Class: Bcome::LoadingBar::PidBucket

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/objects/loading_bar/pid_bucket.rb

Instance Method Summary collapse

Constructor Details

#initializePidBucket

Returns a new instance of PidBucket.



8
9
10
# File 'lib/objects/loading_bar/pid_bucket.rb', line 8

def initialize
  @pids = []
end

Instance Method Details

#-(pid) ⇒ Object



16
17
18
# File 'lib/objects/loading_bar/pid_bucket.rb', line 16

def -(pid)
  @pids -= [pid]
end

#<<(pid) ⇒ Object



12
13
14
# File 'lib/objects/loading_bar/pid_bucket.rb', line 12

def <<(pid)
  @pids << pid
end

#stop_allObject



20
21
22
23
24
# File 'lib/objects/loading_bar/pid_bucket.rb', line 20

def stop_all
  @pids.map do |pid|
    ::Process.kill(::Bcome::LoadingBar::Indicator::Base::SIGNAL_STOP, pid)
  end
end