From Rx Observables vs Dart Streams
:
In many situations, Streams and Observables work the same way. However, if you're used to standard Rx Observables, some features of the Stream api may surprise you. We've included a table below to help folks understand the differences.
Additional information about the following situations can be found by reading the Rx class documentation.
┌────────────────────────────────────────────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬───────────────────────────────────────┐
│ Situation │ Rx Observables │ Dart Streams │
├────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────────┤
│ An error is raised │ Observable Terminates with Error │ Error is emitted and Stream continues │
│ Cold Observables │ Multiple subscribers can listen to the same cold Observable, each subscription will receive a unique Stream of data │ Single subscriber only │
│ Hot Observables │ Yes │ Yes, known as Broadcast Streams │
│ Is {Publish, Behavior, Replay}Subject hot? │ Yes │ Yes │
│ Single/Maybe/Complete ? │ Yes │ No, uses Dart Future │
│ Support back pressure │ Yes │ Yes │
│ Can emit null? │ Yes, except RxJava │ Yes │
│ Sync by default │ Yes │ No │
│ Can pause/resume a subscription*? │ No │ Yes │
└────────────────────────────────────────────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴───────────────────────────────────────┘