Replies: 3 comments
-
Have you considered doing this using the holding queue (instead of a TaskQueue)? A HoldingQueue lives on the native side and retains the order tasks are submitted. You could configure it to run a maximum of one task at a time, thus enforcing sequentially executing each task. However, note that a failed task would be considered complete in this context (and fetch the next task in the queue) so if you cannot check the dependency then this still wouldn't work |
Beta Was this translation helpful? Give feedback.
-
Per #321 I am working on pre-start and post-finished callbacks that run in an isolate when the app is suspended, and that I think make this approach possible. I'm looking for testers, so if this is of interest please check out the discussion and the |
Beta Was this translation helpful? Give feedback.
-
Published native callback in V8.9.0, that are called before a task starts and after a task finishes. The callbacks run in isolates (not in the main isolate) so I am not sure you can accomplish what you describe, but it may be worth exploring. I have no current plans to add more logic around task dependencies |
Beta Was this translation helpful? Give feedback.
-
I have a use case that requires several different upload tasks which depend on a very specific order of uploads.
A
TaskQueue
is not really an option because the app is mainly used offline, there is no guarantee that the app is not suspended when the device finally has Wifi.The order is roughly:
DataTask
UploadTask
in no particular orderUploadTask
I am interested in solution suggestions and wondering if this is something that could be part of the library (great job btw!).
I can imagine a task having dependencies of other taskIds that need to be completed beforehand (similar to priority handling), but not sure if that can be handled on the native side.
Beta Was this translation helpful? Give feedback.
All reactions