Class: GlooIngressAdapter::ResourceObserver::ObserverThread

Inherits:
Thread
  • Object
show all
Defined in:
lib/gloo_ingress_adapter/resource_observer.rb

Overview

Thread running an observer

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(observer:, queue:) ⇒ ObserverThread

Returns a new instance of ObserverThread.



12
13
14
15
16
17
18
19
# File 'lib/gloo_ingress_adapter/resource_observer.rb', line 12

def initialize(observer:, queue:)
  @observer = observer

  super { observer.watch(queue:) }

  self.abort_on_exception = true
  self.name = "observer-#{observer.kind}"
end

Instance Attribute Details

#observerObject (readonly)

Returns the value of attribute observer.



10
11
12
# File 'lib/gloo_ingress_adapter/resource_observer.rb', line 10

def observer
  @observer
end

Instance Method Details

#finishObject



21
22
23
# File 'lib/gloo_ingress_adapter/resource_observer.rb', line 21

def finish
  observer.watcher.finish
end