Class: WatchmonkeyCli::TelegramBot::PromiseHandler

Inherits:
BetterQueue
  • Object
show all
Defined in:
lib/watchmonkey_cli/hooks/telegram_bot.rb

Instance Method Summary collapse

Methods inherited from BetterQueue

#initialize, #sync

Constructor Details

This class inherits a constructor from WatchmonkeyCli::TelegramBot::BetterQueue

Instance Method Details

#await_all!Object



96
97
98
99
100
# File 'lib/watchmonkey_cli/hooks/telegram_bot.rb', line 96

def await_all!
  while p = shift
    p.wait
  end
end

#scrub!Object



90
91
92
93
94
# File 'lib/watchmonkey_cli/hooks/telegram_bot.rb', line 90

def scrub!
  @stor.dup.each_with_index do |p, i|
    @stor.delete(p) if [:fulfilled, :rejected].include?(p.state)
  end
end