This repository has been archived by the owner on Nov 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Thread Handling
Martin Treacy-Schwartz edited this page Mar 15, 2017
·
2 revisions
Almost every piece of this code is run using a dedicated low-priority serial thread queue to avoid UI lag or sudden performance spikes.
The queue will execute each task sequentially. If the SDK add several tasks to the queue then each will be executed in turn. A task could be adding an event or submitting all queued events.
Consider this example with 3 calls.
// Configure build version
gameanalytics::GameAnalytics::configureBuild("alpha 0.1.0");
// Initialize
gameanalytics::GameAnalytics::initialize("12341234123412341234123412341234", "1234123412341234123412341234123412341234");
// Add Design event
gameanalytics::GameAnalytics::addDesignEvent("Some:Event");
The configureBuild is required to be called before initialize is completely finished. The design event call is required after initialize is finished. The queuing will make sure that each task is completely finished before proceeding to the next one.