loading...

re: Explain Futures and Streams in Dart like I'm Five VIEW POST

TOP OF THREAD FULL DISCUSSION
re: By Dart documentation: A Future represents a computation that doesn’t complete immediately. Where a normal function returns the result, an asynch...
 

I had read the docs but was still unsure about the concepts. Your analogies have shed some light on the topic. Especially on streams.

The difference is that Futures are about one-shot request/response (I ask, there is a delay, I get a notification that my Future is ready to collect, and I'm done!) whereas Streams are a continuous series of responses to a single request (I ask, there is a delay, then I keep getting responses until the stream dries up or I decide to close it and walk away).

This answers the questions I've asked in my previous two replies above. So, thanks. Knowing this I can now explore creating streams as tests since it somewhat makes sense now.

Code of Conduct Report abuse