[EMA C++] How can I run the progress all the time

I develop with EMA(C++),

I want the progress run all the time, which is shown as follows:

image

Thank you very much!

Best Answer

  • Hi @luxiangyuan

    These are just simple examples which run for 60s seconds for demonstration purposes.

    The sleep(6000) is there to put the main thread to sleep for 60s, to stop the application exiting immediately - which allows time for some data to be received via the onRefresh / onUpdate callback methods on the API Thread context.

    You just need to stop the application from exiting after 60s to continue receiving data on the API thread.

    So, for example you could just put a while loop around the sleep(6000) so that it keeps sleeping - indefinitely. OR just increase the sleep time if you want it to run for a bit longer before exiting.

Answers

  • Hi @luxiangyuan

    This is just a simple example application to demonstrate how to consume data.

    The sleep(6000) is just there to stop the main application exiting immediately after calling registerClient - so the application has a chance to receive some data on the API thread context via the onRefresh / onUpdate methods etc.

    To make it run longer, just stop the application from exiting until you are ready to do so e.g. increase the time in sleep() call or put a while() loop around the sleep() method call.