Clarify hot/cold Observable behavior
Apparently this remains a tough nut to crack for ReactiveX users.
See for instance ReactiveX/RxJava#3709
We have a brief mention here (http://reactivex.io/documentation/observable.html):
“Hot” and “Cold” Observables When does an Observable begin emitting its sequence of items? It depends on the Observable. A “hot” Observable may begin emitting items as soon as it is created, and so any observer who later subscribes to that Observable may start observing the sequence somewhere in the middle. A “cold” Observable, on the other hand, waits until an observer subscribes to it before it begins to emit items, and so such an observer is guaranteed to see the whole sequence from the beginning.
I think we should start avoiding the terminology "cold"/"hot". With functions, for instance, we don't talk about cold/hot functions.
We should instead introduce Observables as if they would always be "cold", because they by default. For instance check this StackOverflow answer https://stackoverflow.com/questions/25338930/reactive-programming-rxjs-vs-eventemitter-in-node-js/25340716
@staltz is right, but we do need some sort of idiom.
Really it's that the Producer is "hot". And the producer could live outside of the Observable.
e.g. this is "hot":
const socket = new WebSocket('ws://someserver/socket');
const soHotRightNow = Observable.create(observer => {
socket.onmessage = (e) => observer.next(x);
socket.onerror = (e) => observer.error(e);
socket.onclose = () => observer.complete();
});
... even a "published" observable falls under that. It's "hot" because the Observable that was published is still active. The "published observable" just connects your Observer to the active source observable when you subscribe.