Suggestion about Thread Management

Silver Contributor
Silver Contributor

What do you suggest us to have initialization on main or background thread. if so do we make a call prior to initialization?

4 REPLIES 4

Suggestion about Thread Management

Silver Contributor
Silver Contributor
What is the case in Tealium-swift. we would like to integrate tealium-swift?

Suggestion about Thread Management

Moderator
Moderator
@SaiTeja it's fine to initialize the Swift library on a background thread. You can also specify an explicit queue to use for data dispatches. See "setDispatchQueue" in the TealiumConfig documentation here: https://community.tealiumiq.com/t5/Tealium-for-Swift/Swift-Class-TealiumConfig/ta-p/17095

The link to the full Swift documentation is here: https://community.tealiumiq.com/t5/Tealium-for-Swift/tkb-p/swift
Check out our new Swift integration library for iOS, macOS, tvOS and watchOS: https://github.com/Tealium/tealium-swift with updated
documentation https://community.tealiumiq.com/t5/Swift/tkb-p/swift.

Suggestion about Thread Management

Silver Contributor
Silver Contributor

Can we make a call to tealium prior to initialization?

 

Suggestion about Thread Management

Moderator
Moderator
@SaiTeja currently, no. You would need to wait until tealium is initialized before the first call. We're working on supporting this in a future update. There is an optional completion handler you can specify when initializing Tealium, so you could buffer your calls in a queue, and then use the completion handler to clear the queue when the Tealium object has initialized.
Check out our new Swift integration library for iOS, macOS, tvOS and watchOS: https://github.com/Tealium/tealium-swift with updated
documentation https://community.tealiumiq.com/t5/Swift/tkb-p/swift.
Public