feat: add a configurable setting to put the CloudModeProcessor to sleep for a specified interval #460
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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)
#417
Type of change
Checklist: