wendy / com.levibostian.wendy.service / PendingTask / runTask

runTask

@WorkerThread abstract fun runTask(): PendingTaskResult

The method Wendy calls when it's time for your task to run. This is where you will perform database operations on the device, perform API calls, etc.

When you are done performing the task, return if the task was run successfully or not. You have 3 options as outlined in PendingTaskResult.

This method is run on a background thread for you already. Make sure to run all of your code in a synchronous style. If you would like to run async code, check out the BEST_PRACTICES.md file in the root of this project to learn more on how you could do this.

See Also

PendingTaskResult