Skip to content

Instantly share code, notes, and snippets.

@mattpodwysocki
Created July 30, 2010 02:06
Show Gist options
  • Save mattpodwysocki/499735 to your computer and use it in GitHub Desktop.
Save mattpodwysocki/499735 to your computer and use it in GitHub Desktop.
actions = {
:on_next => proc {|next_value| puts "Next: #{next_value}" },
:on_error => proc {|exception| puts "Exception: #{exception.message}"},
:on_completed => proc { puts "done!" }
}
observer = Observer.new actions
observable = Observable.range(2,2, Scheduler.new_thread).select_many do |x|
Observable.range(x * 3, 3, Scheduler.new_thread)
end
observable.subscribe(observer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment