Thomvis / BrightFutures

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

Synchronous resolution of Futures #200

Closed truizlop closed 6 years ago

truizlop commented 6 years ago

I have noticed issue #19, which is similar to the problem that I am having. I need a synchronous way of resolving a Future. I am aware of forced, but as stated in the other issue, there is a deadlock in the way that I am using it.

I am using SwiftCheck for my tests and I need this synchronous way of resolving a Future in order to be able to compare two different instances. Is there any possibility to overcome this problem?

Thomvis commented 6 years ago

Can you give an example of what you’re trying to do, e.g. using forced so I can provide relevant feedback. Thanks!

truizlop commented 6 years ago

Nevermind, I just found a workaround for what I was trying to do.