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 13 |
# File 'lib/tpx.rb', line 9 def add(args, &block) jid = args.shift @exec.schedule_m_add([@q, jid, args], &block) @cnt += 1 end |
#resolve ⇒ Object
15 16 17 |
# File 'lib/tpx.rb', line 15 def resolve @exec.schedule_m_read(@q, @cnt) end |