Skip to content

Instantly share code, notes, and snippets.

@apathyboy
Created December 5, 2010 06:42
Show Gist options
  • Save apathyboy/728880 to your computer and use it in GitHub Desktop.
Save apathyboy/728880 to your computer and use it in GitHub Desktop.
Waiting to trigger an event until a collection of futures has returned.
dispatch.notify_when(server_started_event, [=] {
if (crafting.is_ready() && trade.is_ready() && travel_map.is_ready()) {
cout << "All startup tasks have finished, dispatch this event!\n";
return true;
}
return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment