Class: Fleiss::Executor
- Inherits:
-
Concurrent::SimpleExecutorService
- Object
- Concurrent::SimpleExecutorService
- Fleiss::Executor
- Defined in:
- lib/fleiss/executor.rb
Instance Attribute Summary collapse
-
#max_size ⇒ Object
readonly
Returns the value of attribute max_size.
Instance Method Summary collapse
Instance Attribute Details
#max_size ⇒ Object (readonly)
Returns the value of attribute max_size.
5 6 7 |
# File 'lib/fleiss/executor.rb', line 5 def max_size @max_size end |
Instance Method Details
#capacity ⇒ Object
11 12 13 14 |
# File 'lib/fleiss/executor.rb', line 11 def capacity val = @max_size - @count.value val.positive? ? val : 0 end |
#post(&block) ⇒ Object
7 8 9 |
# File 'lib/fleiss/executor.rb', line 7 def post(&block) super unless capacity.zero? end |