copper-leaf / ballast

Opinionated Application State Management framework for Kotlin Multiplatform
https://copper-leaf.github.io/ballast/
BSD 3-Clause "New" or "Revised" License
144 stars 11 forks source link

Add scheduling module #55

Closed cjbrooks12 closed 4 months ago

cjbrooks12 commented 9 months ago

One use case for Ballast in server side applications, or in front end apps without Androids WorkManager, is in scheduling jobs to be run repeatedly in the background. Ballast could support this fairly easily by creating a new module that adds an Interceptor into a View model which dispatches inputs at the appropriate time.

A first POC could be a basic timer-based scheduler. The next addition would be supporting cron syntax for running jobs at a specific time interval.

A final step would be to somehow run the ViewModel in a WorkManager and tie into the filtering behaviors there. It would also be nice to support the same kind of filtering by network state or other properties in iOS or JS.

Open questions:

cjbrooks12 commented 4 months ago

Added in PR #66, to be available in Ballast version 4.1.0.