This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
/** | |
* This is a quick abstraction over non-blocking asynchronous deferreds. In a | |
* way you can see those as non-blocking futures (whereas std::future are | |
* blocking). | |
* This implementation is devoid of fanciness. Amongst other things: | |
* - Deferreds are not cancelable | |
* - They are not threadsafe. Callbacks are ran in whichever thread the | |
* deferred was triggered and there's no mutex to protect from race condition | |
* while registering callbacks/setting values. This is what we use libev |