16 Oct
2012
16 Oct
'12
5:17 p.m.
What if the event poll was just inside a task, not requiring any loop in the scheduler, or even knowledge by the scheduler, in any way?
I agree, every task can handle all the asynchrony within it and just expose a single 'completed' notification (a Future or similar) to its caller. This is the portable solution - it is going to be less than optimal in some cases, but is much more composable and extensible. As a Python developer, I like the model of "I call this function normally and it gives me a Future to let me know when it's done but I don't really know how it's doing it." (Incidentally, I like it as a C# and C++ developer too.)