Class: TPX::Prom
- Inherits:
-
Object
- Object
- TPX::Prom
- Defined in:
- lib/tpx.rb
Instance Method Summary collapse
- #add(args, &block) ⇒ Object
-
#initialize(exec) ⇒ Prom
constructor
A new instance of Prom.
- #resolve ⇒ Object
Constructor Details
#initialize(exec) ⇒ Prom
Returns a new instance of Prom.
3 4 5 6 7 |
# File 'lib/tpx.rb', line 3 def initialize(exec) @cnt = 0 @exec = exec @q = exec.schedule_m_build end |
Instance Method Details
#add(args, &block) ⇒ Object
9 10 11 12 |
# File 'lib/tpx.rb', line 9 def add(args, &block) @exec.schedule_m_add([@q, @cnt, args], &block) @cnt += 1 end |
#resolve ⇒ Object
14 15 16 |
# File 'lib/tpx.rb', line 14 def resolve @exec.schedule_m_read(@q, @cnt) end |