StanfordSpezi / SpeziScheduler

Scheduler Module for the Stanford Spezi Ecosystem
https://swiftpackageindex.com/StanfordSpezi/SpeziScheduler/documentation/
MIT License
3 stars 3 forks source link

Schedule Tasks at a Predefined Time in the Future #18

Open PSchmiedmayer opened 11 months ago

PSchmiedmayer commented 11 months ago

Use Case

Some tasks are not repeating, and it should be possible to schedule these types of tasks independent of a start and end date as well as the need for a repetition definition.

Problem

The current API surface only offers mechanisms to offer repeating tasks. While the repetition can be set for N=1 we should offer a nicer API surface, including the removal of a requirement to define a start and end date.

Solution

The implemented functionality should provide the key feature to schedule tasks at a specific time or at a specific distance.

The API surface can move the start and end date in a Repetition type and add a new enum in the Schedule type that would then encapsulate the repetition and the fixed scheduling functionality.

Defining a task at a specific distance should be time-zone independent.

Code of Conduct

imanabu commented 3 weeks ago

Firebase functions have a nice feature that it will execute a function at pre-determined intervals. I use this for one of my firebase apps to remind users of upcoming events. This would be very easy to implement.

PSchmiedmayer commented 6 days ago

@imanabu Thanks for the input! Spezi Scheduler is currently doing all scheduling, planning, and storage of tasks is happening locally on the device and Firebase and others could be used as other storage backends in the future. As noted in #20 we should probably first tackle this general architectural decision and rework before we think about integrating a server-side logic to schedule tasks which would probably only be applicable for push notifications and data storage.