Name building blocks of Reactive Programming

Technology CommunityCategory: Reactive ProgrammingName building blocks of Reactive Programming
VietMX Staff asked 3 years ago

Observables

  • Observables are the data source /stream
  • can emit multiple values, just one, or none
  • can also emit errors
  • can be infinite or finite, in which case they emit their completion event

Subscribers

  • Subscribers subscribe to Observables
  • they consume/observe the data
  • they also receive the errors and completion events from the Observable

Operators

  • used to create Observables (timers, ranges, from other data sources)
  • used to transform Observables (map, buffer, group, scan, etc)
  • used to filter Observables (filter, distinct, skip, debounce, etc)
  • used to combine Observables (zip, merge, combine latest, etc)

Schedulers

  • mechanism that allows us to easily add threading to our Observables and Subscribers
  • subscribeOn() specifies on which Scheduler to Observables should operate
  • observeOn() specifies on which Scheduler/Thread the Subscribers should be notified