Skip to content

Spike: Research Isolate-based Background Task Execution #2

@rickhohler

Description

@rickhohler

Problem:
Currently, orbit_task focuses on platform-native background execution (WorkManager, BGTaskScheduler). However, developers often need to run heavy computations or long-running tasks while the app is in the foreground without blocking the Main UI thread.

Goal:
Research the feasibility and design of an Isolate-based execution model within orbit_task. This would allow developers to easily offload tasks to a separate Dart Isolate with a simple API, similar to how they schedule native background tasks.

Key Questions:

  1. How can we simplify the API for spawning and communicating with isolates (e.g., compute function vs. long-lived Isolates)?
  2. Can we reuse the existing BackgroundTask data structure for isolate tasks?
  3. How should we handle bidirectional communication (progress updates) between the UI isolate and the worker isolate?
  4. What are the performance implications and limitations (e.g., platform channel access from background isolates)?
  5. Should this be part of the core orbit_task package or a separate module?

Deliverables:

  • A design document or architecture proposal.
  • A proof-of-concept (POC) demonstrating simple task offloading to an Isolate.
  • Recommendations for future implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions