simple c++ example using asynchronous callback