optimize the example for asio loop