Skip to main content

durable_queue_workmanager 0.1.0 copy "durable_queue_workmanager: ^0.1.0" to clipboard
durable_queue_workmanager: ^0.1.0 copied to clipboard

Run durable_queue tasks in Workmanager background jobs on Android and iOS, with a lease that keeps the app and the background job from running the queue twice.

0.1.0 #

  • Initial release.
  • QueueBackgroundWork: registers a periodic Workmanager job (schedule, cancel) and runs the queue in it (handles, run): takes the lease, drains for up to timeLimit (20 seconds on iOS, 8 minutes elsewhere by default), and closes the queue. On Android it also registers a one-off job for the next due task, or soon after a run that hit the time limit.
  • LeasedQueueRunner: runs the app's queue only while it holds the lease; waits for the lease while a background job drains, and releases it on stop.
  • LeasedQueueLifecycle.attach(runner): starts the runner in the foreground and stops it when the app is hidden or paused.
  • drainWithLease: the background part without Workmanager, returning a LeasedDrainResult.
  • foregroundService: run the jobs as Android foreground services for longer runs.
  • QueueLease interface and FileQueueLease, a lease kept in a file that works between isolates of one process, renewed by its holder and taken over when abandoned.
  • Requires durable_queue 0.5.3 or later, workmanager 0.10.10 or later, and Flutter 3.38 or later. Android and iOS.
0
likes
160
points
0
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Run durable_queue tasks in Workmanager background jobs on Android and iOS, with a lease that keeps the app and the background job from running the queue twice.

Repository (GitHub)
View/report issues
Contributing

Topics

#queue #background #workmanager #offline #retry

License

MIT (license)

Dependencies

durable_queue, flutter, workmanager

More

Packages that depend on durable_queue_workmanager