Thomvis / BrightFutures

Write great asynchronous code in Swift using futures and promises
MIT License
1.9k stars 184 forks source link

Question: Enforcing order of execution when dealing with many futures #161

Closed golfguy0082 closed 7 years ago

golfguy0082 commented 7 years ago

This feels like I'm making it harder than it needs to be......suppose you have n closures that return futures:

var methods: [() -> Future<String, MyError>]

Suppose I want to execute these closures IN ORDER (such that methods[n+1] will begin execution at the completion of methods[n]). At first I thought I wanted the sequence() method, but that method assumes I have FUTURES instead of closures that RETURN a future. Is this ACTUALLY a hard problem, or am I being an idiot?

Thomvis commented 7 years ago

Closing this issue because of inactivity. Feel free to reopen if you have an update.