Class: XfOOrth::XfOOrth_SyncBundle
- Inherits:
-
XfOOrth_Bundle
- Object
- XfOOrth_Bundle
- XfOOrth::XfOOrth_SyncBundle
- Defined in:
- lib/fOOrth/library/sync_bundle_library.rb
Overview
The fOOrth Synchronized Bundle class. A bundle contains multiple fibers.
Instance Method Summary collapse
-
#add_fibers(fibers) ⇒ Object
Add the fibers to this bundle.
-
#initialize(fibers = []) ⇒ XfOOrth_SyncBundle
constructor
Build up the synchronized bundle instance.
-
#length ⇒ Object
how many fibers in this bundle?.
-
#status ⇒ Object
What is the status of this bundle?.
-
#step(vm) ⇒ Object
Let the fiber run for one step.
Methods inherited from XfOOrth_Bundle
Constructor Details
#initialize(fibers = []) ⇒ XfOOrth_SyncBundle
Build up the synchronized bundle instance
13 14 15 16 |
# File 'lib/fOOrth/library/sync_bundle_library.rb', line 13 def initialize(fibers=[]) @sync = Mutex.new super(fibers) end |
Instance Method Details
#add_fibers(fibers) ⇒ Object
Add the fibers to this bundle.
19 20 21 |
# File 'lib/fOOrth/library/sync_bundle_library.rb', line 19 def add_fibers(fibers) @sync.synchronize{super(fibers)} end |
#length ⇒ Object
how many fibers in this bundle?
29 30 31 |
# File 'lib/fOOrth/library/sync_bundle_library.rb', line 29 def length @sync.synchronize{super} end |
#status ⇒ Object
What is the status of this bundle?
24 25 26 |
# File 'lib/fOOrth/library/sync_bundle_library.rb', line 24 def status @sync.synchronize{super} end |
#step(vm) ⇒ Object
Let the fiber run for one step
34 35 36 |
# File 'lib/fOOrth/library/sync_bundle_library.rb', line 34 def step(vm) @sync.synchronize{super(vm)} end |