Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Background service refactoring #15

Depau opened this issue Dec 23, 2018 · 0 comments


Copy link

commented Dec 23, 2018

This issue tracks progress on the background worker service refactoring, which should help me implement the planned features more easily by making the app more modular.

New project structure

  • Worker

    • Does things
    • Can have listeners attached to it
    • Sends progress to listeners
  • Foreground service

    • Listens to events from worker
    • Displays progress in notification
  • Broadcast sender

    • Listens to events from worker
    • Sends broadcasts
  • Progress activity

    • Receives events from broadcasts
    • Displays progress in the GUI

Event DTOs

As part of the refactoring, a bunch of event DTOs will be introduced. They will be Parcelable so they can be packed into intents and broadcasts.

  • Processing start DTO content:

    • Operation ID (to support multiple parallel operations)
    • Operation type (copy raw image, copy DMG, create Windows installer USB, etc.)
    • Input source name
    • Output destination name
    • List of operation steps (i.e. for Windows USB: format drive, copy files, etc.)
  • Progress event DTO content:

    • Operation ID
    • Current operation type (i.e. copying file, verbatim image copy, DMG extract and copy, etc.)
    • Current operation progress (optional)
    • Total operation progress (mandatory)
    • ETA data (optional, if it makes sense to calculate ETA)
      • Estimated time remaining (mandatory)
      • Current rate (optional)
      • Current rate unit (only if current speed is provided, e.g. bytes/sec)
  • Processing done DTO content:

    • Operation ID
    • Finish reason (success, error)
    • Error reason (if error, enum)
    • Error data (if error, parcelable)

All this data can be used to display meaningful progress info while making it easy to add new kinds of operations.

Progress checklist

  • Create worker and listener interfaces/ABCs
  • Refactor currently implemented interfaces
  • Implement listeners
    • Foreground service
    • Broadcast sender
  • Make foreground service display events in notification
  • Create new progress activity
    • GUI design
    • Implementation

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@Depau Depau added the enhancement label Dec 23, 2018

@Depau Depau added this to the v2.0 milestone Dec 23, 2018

@Depau Depau added this to In progress in Project development Dec 23, 2018

@Depau Depau referenced this issue Dec 23, 2018
0 of 7 tasks complete

@Depau Depau pinned this issue Feb 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant
You can’t perform that action at this time.