What's the difference between Swift's Dispatchqueue and Flutter's Future?

Viewed 165

First of all please don't laugh at my question I am still a newbie. Recently I have started learning iOS development and found about Dispatchqueue (documentation link). After reading the documentation, I had a question on my mind.

  • Is it similar like Flutter's Future(documentation link)? Or are there any differences between them? If yes, then what are the differences?

I searched a lot but couldn't find a proper answer which would clear my confusion. Thanks in advance.

1 Answers

DispatchQueue is for parallelization your tasks. It works according to the first in first out principle, means the first tasks will be done first etc. A Future sounds for me like a "delayed" task, means your task will be done in the future but not in the background like in a DispatchQueue. Some good information for DispatchQueue are here Appropriately-using-dispatchqueue-main :-)

Related