asmodehn / WkCocos

Cocos wrapping for quick wkcmake convention based builds.
4 stars 7 forks source link

Callbacks returned from Managers should instead be STL classes #52

Open asmodehn opened 10 years ago

asmodehn commented 10 years ago

When we pass a callback to a Manager ( high level of abstraction of Wkcocos feature ) the user can pass a lambda function. However he has very little control on what it can do with it ( wait for it or not, do something just after, etc. )

Instead we should think about returning futures ? Or some STL Async class... the point is to give the user more control about the Async behaivor going on in WkCocos ( due to network calls, or performance constraints ( split into small task to maximize update speed ), but still keep close to the standard.

A nice explanation of these : http://stackoverflow.com/questions/11004273/what-is-stdpromise