backpressure aware(consumer buffering) Set of interfaces to interop between systems(language neutral) that adhere to the spec Max utilization of CPU, multi core, parallel processing Networking aware(TCP, UDP, HTTP and WebSockets) serialization/deserialization
data Observer - parent class of an object that can see a stream of data Subscriber - an observer that watches the stream of data from an observable, and implements code to deal with the data Subscription - the object of a subscriber who is watching an observable source, can unsubscribe from the source
or asynchronous Observables push changes to subscribers Subscribers receive changes from Observables Subscribers implement data manipulation, data reaction, error handling Do work upon subscription, or at the end of a subscription Termination conditions like success, error, or non terminating
flexible and easy to use Cons: Data transfer between architectural layers/threads, flexible and easy to use Dynamically typed spaghetti code on a bad architecture/understanding Hard to reason about, unknown life time management depending on the pub/sub implementation(static/dynamic) Multiple events, timing issues, chaining events requires state management, cognitive load
that connects you to a data producer Hot produces data regardless subscriptions, often in great quantity Cold produces data only when subscribed to, often in fixed amount Both may or may not terminate, thus data can always be streamed.
an observable source Called on whatever thread it was assigned on Can offer deterministic cancellation if implemented Many observers can be subscribed to one observable, but can receive totally different parts/transforms of the data
use: network, database, file system computation - bounded thread pool per cpu processor, long run/intense tasks immediate - executes work right away on current thread trampoline - queues work on current thread newThread - per call, uncommon due to heavy thread creation costs
to create a new stream based on composition logic(smaller and more declarative expression) startWith, merge, zip, and, then, when, combineLatest, join, groupJoin, switchOnNext Distributed composition logic, have operations chained together and referenced as a single operation to be applied on the stream of data
of operation like: take, combine, switch, skip sources of data, or to create new data streams. buffer - bundle data into N objects and emit the bundle cache - save results for future calls delay - wait N amount of time time before continuing map - apply a function on the data and return the data(can be a new type) zip - combine observables into one new observable
one or more observables, can pass items it observes as retransmissions or new data AsyncSubject - emits the last value only after the observable completes BehaviorSubject - on subscription, emits the most recent data and continues to stream its observed data PublishSubject - emits entire history of data that was streamed before subscription ReplaySubject - emits entire history of data to subscribers and continues, may have a buffer limit
with reactive interfaces Clear code semantic with an understanding of data source, not state Deterministic threading abstraction to build upon, sequence, parallel, async Easier to test by injecting mock values into the stream Common cross domain technological terminology for any project Community of adoption: http://www.reactivemanifesto.org/ Long term knowledge for system and CPU management
management for lifetime(else memory leaks) Large API of operators, additional APIs for programming language specific details Scattered and versioned learning resources Language implementation feature disparity(based on community commit effort) Project adoption is difficult, must be done in small phases, to manage complexity Requires a new way of thinking