Guest User

Untitled

a guest
May 3rd, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.44 KB | None | 0 0
  1. * `Functional Programming` is a model of programming that transform and compose stream of immutable sequences by applying map, filter and reduce. Events are immutable because you can't change history.
  2. * `Reactive Programming` is a model of programming focuses on data flow and change propagation.
  3. * `ReactiveX` is an API that focuses on asynchronous composition and manipulation of observable streams of data or events by using a combination of the Observer pattern, Iterator pattern, and features of Functional Programming.
  4. * `RxJava` is the open-source implementation of `ReactiveX` in Java.
  5. * `RxJava` is a Java VM implementation of `ReactiveX` (Reactive Extensions): a library for composing asynchronous and event-based programs by using observable sequences.
  6. * `RxAndroid` is a lightweight extension to RxJava that providers a Scheduler for Android’s Main Thread, as well as the ability to create a Scheduler that runs on any given Android Handler class.
  7. * The two main classes are `Observable` and `Subscriber`.
  8. * `Observable` is a class that emits a stream of data or events.
  9. * `Subscriber` is a class that acts upon the emitted items.
  10. * A `cold observable` is one to which no one has subscribed, and is thus inanimate.
  11. * Observable `subscribe` has many overloads. You can choose to implement an entire `Observer` with `onNext`, `onComplete` and `onError`, or only some of these in the form of an `Action1`.
  12. * Using `Observable.subscribeOn()` can define a thread that will run our Observable’s code (the long running operation).
  13. * Using `Observable.observeOn()` can define a thread that is used to monitor and check for newly emitted items from the Observable (the Subscriber’s onNext, onCompleted, and onError methods execute on the observeOn() thread).
  14. * RxJava comes with several out-of-the-box `Schedulers` to use with Observables, such as `Schedulers.io()` (for blocking I/O operations), `Schedulers.computation()` (computational work), and `Schedulers.newThread()` (creates new thread for the work).
  15. * `Rx` was first conceived by Erik Meijer on the Microsoft .NET platform, as a way of combining data or event streams with reactive objects and functional composition
  16. * In Rx, events are modeled as `observable streams` to which `observers` are `subscribed`. These streams, or observables for short, can be `filtered`, `transformed`, and `composed` in various ways before their results are `emitted` to an `observer`.
  17. * The standard flow of an `Observable` is to emit one or more items, and then complete successfully or with an error.
  18. * An `Observable` can have multiple `Subscribers`, and for each item emitted by the `Observable`, the item will be sent to the `Subscriber.onNext()` method to be handled.
  19. * Once an `Observable` has finished emitting items, it will call the `Subscriber.onCompleted()` method, or if there is an error the `Observable` will call the `Subscriber.onError()` method.
  20. * `RxJava`, at it’s core, is about two things: `Observables` and `Observers`.
  21. * `Observables` are said to “emit” values.
  22. * `Observers`, watch `Observables` by “subscribing” to them.
  23. * When an `Observer` subscribes to an `Observable` a `Subscription` is created.
  24. * A `Subscription` represents a connection between an `Observer` and an `Observable`.
  25. * `Subjects` are special objects that are both an `Observable` and an `Observer`.
  26. * The basic building blocks of reactive code are `Observables` and `Subscribers`.
  27. * An `Observable` emits items; a `Subscriber` consumes those items.
Add Comment
Please, Sign In to add comment