123456789_123456789_123456789_123456789_123456789_

Class: Concurrent::DaemonThreadFactory

Relationships & Source Files
Inherits: Object
Defined in: lib/concurrent-ruby/concurrent/executor/java_executor_service.rb

Class Method Summary

Instance Method Summary

Constructor Details

.new(daemonize = true) ⇒ DaemonThreadFactory

[ GitHub ]

  
# File 'lib/concurrent-ruby/concurrent/executor/java_executor_service.rb', line 85

def initialize(daemonize = true)
  @daemonize = daemonize
  @java_thread_factory = java.util.concurrent.Executors.defaultThreadFactory
end

Instance Method Details

#newThread(runnable)

[ GitHub ]

  
# File 'lib/concurrent-ruby/concurrent/executor/java_executor_service.rb', line 90

def newThread(runnable)
  thread = @java_thread_factory.newThread(runnable)
  thread.setDaemon(@daemonize)
  return thread
end