Class: JRL::Fiber
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- JRL::Fiber
- Defined in:
- lib/jretlang/fiber.rb
Instance Method Summary collapse
-
#initialize ⇒ Fiber
constructor
A new instance of Fiber.
- #schedule_one_time(delay, time_unit = JRL::Concurrent::TimeUnit::SECONDS, &block) ⇒ Object
- #schedule_repeating(delay, interval, time_unit = JRL::Concurrent::TimeUnit::SECONDS, &block) ⇒ Object
Constructor Details
Instance Method Details
#schedule_one_time(delay, time_unit = JRL::Concurrent::TimeUnit::SECONDS, &block) ⇒ Object
7 8 9 |
# File 'lib/jretlang/fiber.rb', line 7 def schedule_one_time( delay, time_unit=JRL::Concurrent::TimeUnit::SECONDS, &block ) @f.schedule( block, delay, time_unit ) end |
#schedule_repeating(delay, interval, time_unit = JRL::Concurrent::TimeUnit::SECONDS, &block) ⇒ Object
11 12 13 |
# File 'lib/jretlang/fiber.rb', line 11 def schedule_repeating( delay, interval, time_unit=JRL::Concurrent::TimeUnit::SECONDS, &block ) @f.schedule_with_fixed_delay( block, delay, interval, time_unit ) end |