Package 

Object ThreadUtils


  • @RestrictTo(value = {RestrictTo.Scope.LIBRARY_GROUP}) 
    public class ThreadUtils
    
                        

    Thread management utilities for the CloudX SDK.

    Provides optimized thread pools and executors for different types of operations, ensuring efficient resource usage and proper thread lifecycle management.

    • Method Detail

      • createMainScope

         final CoroutineScope createMainScope(String tag)

        Convenience method to create a main-thread component scope (uses Main dispatcher). Use for UI-related components like ad managers, UI controllers, etc.

      • createMainImmediateScope

         final CoroutineScope createMainImmediateScope(String tag)

        Convenience method to create a main-thread component scope (uses Main.immediate dispatcher). Use for UI-related components like ad managers, UI controllers, etc.

      • createIOScope

         final CoroutineScope createIOScope(String tag)

        Convenience method to create a background component scope (uses IO dispatcher). Use for background components like trackers, network managers, etc.

      • runOnMain

         final Unit runOnMain(Function0<Unit> block)

        Run block on the main thread. Executes inline if already on main, otherwise posts to the main looper via a cached Handler.