Future(s) for D.

Dragos Carp via Digitalmars-d digitalmars-d at puremagic.com
Sat Jun 20 06:33:32 PDT 2015


On Saturday, 20 June 2015 at 12:35:11 UTC, weaselcat wrote:
> I recently read this facebook post on their future 
> implementation in their Folly library.
>
> https://code.facebook.com/posts/1661982097368498
>
> This made me slightly envious. Thoughts on a D implementation?

Even if the callbacks are sequentially listed, the "callback 
hell" is still there.

A better solution is to use fibers. You can take a look at a 
fibers[1] and tasks[2] implementation in asynchronous library[3].

[1] - 
https://github.com/dcarp/asynchronous/blob/master/src/asynchronous/futures.d
[2] - 
https://github.com/dcarp/asynchronous/blob/master/src/asynchronous/tasks.d
[3] - http://code.dlang.org/packages/asynchronous


More information about the Digitalmars-d mailing list