Class: LogStash::Outputs::Application_insights::Notification_recovery
- Inherits:
-
Object
- Object
- LogStash::Outputs::Application_insights::Notification_recovery
- Defined in:
- lib/logstash/outputs/application_insights/notification_recovery.rb
Constant Summary collapse
- @@instance =
Notification_recovery.new
Class Method Summary collapse
Instance Method Summary collapse
- #close ⇒ Object
- #enqueue(tuple) ⇒ Object
-
#initialize ⇒ Notification_recovery
constructor
A new instance of Notification_recovery.
- #recover_later(tuple) ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize ⇒ Notification_recovery
Returns a new instance of Notification_recovery.
26 27 28 29 30 31 32 33 |
# File 'lib/logstash/outputs/application_insights/notification_recovery.rb', line 26 def initialize configuration = Config.current @resurrect_delay = configuration[:resurrect_delay] @queue = Queue.new @closing = nil @thread = nil end |
Class Method Details
.instance ⇒ Object
101 102 103 |
# File 'lib/logstash/outputs/application_insights/notification_recovery.rb', line 101 def self.instance @@instance end |
Instance Method Details
#close ⇒ Object
56 57 58 59 |
# File 'lib/logstash/outputs/application_insights/notification_recovery.rb', line 56 def close @closing = true # @thread.join end |
#enqueue(tuple) ⇒ Object
52 53 54 |
# File 'lib/logstash/outputs/application_insights/notification_recovery.rb', line 52 def enqueue ( tuple ) @queue << tuple end |
#recover_later(tuple) ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/logstash/outputs/application_insights/notification_recovery.rb', line 40 def recover_later ( tuple ) @notification_state_on = false if stopped? @state ||= State.instance @state.dec_pending_notifications @shutdown ||= Shutdown.instance @shutdown.display_msg("!!! notification won't recover in this session due to shutdown") else @queue << tuple end end |
#start ⇒ Object
35 36 37 38 |
# File 'lib/logstash/outputs/application_insights/notification_recovery.rb', line 35 def start @test_notification = Test_notification.new @thread = recovery_thread end |