@jca02266 should we change the order of the parameter on #while so that we could use a block instead?
require 'rx'
i = 0
# Repeat until condition no longer holds
source = RX::Observable.while(RX::Observable.just 42) { i += 1; i <= 3 }
subscription = source.subscribe(
lambda {|x|
puts 'Next: ' + x.to_s
},
lambda {|err|
puts 'Error: ' + err.to_s
},
lambda {
puts 'Completed'
})
# => Next: 42
# => Next: 42
# => Next: 42
# => Completed