Added a builder method withEventDispatchSleepInterval(int eventDispatchSleepInterval) that allows users to configure the sleep interval for the CloudModeProcessor when it is idle (i.e., no events to process). The default interval is 1 second, ensuring no change in existing behaviour. This feature enables users to conserve battery by putting the CloudModeProcessor thread to sleep for a specified interval.
Also, note that the value specified in withEventDispatchSleepInterval(...) should not exceed the sleepTimeOut value; otherwise, the default value of 1 second will be used.
NOTE: Currently, the default behaviour dictates that if there are no events to process, the CloudModeProcessor checks every 1 second for new events in the database. This ensures prompt event delivery. Once the user changes this default setting, the thread will sleep for a specified interval before checking the database again for new events.
Description
Added a builder method
withEventDispatchSleepInterval(int eventDispatchSleepInterval)
that allows users to configure the sleep interval for theCloudModeProcessor
when it is idle (i.e., no events to process). The default interval is1 second
, ensuring no change in existing behaviour. This feature enables users to conserve battery by putting theCloudModeProcessor
thread to sleep for a specified interval.Also, note that the value specified in
withEventDispatchSleepInterval(...)
should not exceed thesleepTimeOut
value; otherwise, the default value of 1 second will be used.NOTE: Currently, the default behaviour dictates that if there are no events to process, the
CloudModeProcessor
checks every1 second
for new events in the database. This ensures prompt event delivery. Once the user changes this default setting, the thread will sleep for a specified interval before checking the database again for new events.Fixes # (issue) https://github.com/rudderlabs/rudder-sdk-android/issues/417
Type of change
Checklist: