Class: XThreads
- Inherits:
-
Hash
- Object
- Hash
- XThreads
- Defined in:
- lib/xthreads.rb
Overview
file: xthreads.rb
Defined Under Namespace
Classes: XThread
Instance Method Summary collapse
- #create_loop(name, options = {}, &blk) ⇒ Object
- #create_thread(name, options = {}, &blk) ⇒ Object
-
#initialize ⇒ XThreads
constructor
A new instance of XThreads.
Constructor Details
#initialize ⇒ XThreads
Returns a new instance of XThreads.
7 8 9 |
# File 'lib/xthreads.rb', line 7 def initialize() @threads = self end |
Instance Method Details
#create_loop(name, options = {}, &blk) ⇒ Object
66 67 68 69 |
# File 'lib/xthreads.rb', line 66 def create_loop(name, ={}, &blk) @threads[name] = XThread.new name, , &blk @threads[name] end |
#create_thread(name, options = {}, &blk) ⇒ Object
71 72 73 74 75 |
# File 'lib/xthreads.rb', line 71 def create_thread(name, ={}, &blk) cleanup @threads[name] = XThread.new name, .merge(interval: 0, loop: false), &blk @threads[name] end |