Class: LogStash::Inputs::Azure::NamedThreadFactory
- Inherits:
-
Object
- Object
- LogStash::Inputs::Azure::NamedThreadFactory
- Defined in:
- lib/logstash/inputs/named_thread_factory.rb
Instance Method Summary collapse
-
#initialize(name, id) ⇒ NamedThreadFactory
constructor
A new instance of NamedThreadFactory.
- #newThread(runnable) ⇒ Object
Constructor Details
#initialize(name, id) ⇒ NamedThreadFactory
Returns a new instance of NamedThreadFactory.
8 9 10 11 12 |
# File 'lib/logstash/inputs/named_thread_factory.rb', line 8 def initialize(name, id) @name = name @id = id @counter = AtomicInteger.new(-1) end |
Instance Method Details
#newThread(runnable) ⇒ Object
14 15 16 |
# File 'lib/logstash/inputs/named_thread_factory.rb', line 14 def newThread(runnable) java.lang.Thread.new(runnable, @name + "-" + @counter.increment_and_get.to_s + "-" + @id.to_s) end |