Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • briar briar
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 782
    • Issues 782
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 7
    • Merge requests 7
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • briar
  • briarbriar
  • Issues
  • #2229

Closed
Open
Created Nov 25, 2021 by akwizgran@akwizgranOwner

Mailbox client superclass

Mailbox clients for communicating with our own mailbox and contacts' mailboxes are managed by a singleton mailbox client manager (#2228).

We'll need different client implementations for our own mailbox (#2290) and contacts' mailboxes (#2289), but there will be a shared interface and some shared code. This ticket covers the code shared between the client for our own mailbox and the client for a contact's mailbox.

Interface:

  • The manager can create and destroy clients
  • The manager can assign/deassign contacts for upload or download
  • The client's upload and download workers can request connectivity checks

Implementation:

  • At any given time the client may have multiple upload workers and/or a single download worker
  • The client has a connectivity check method, which takes an observer as an argument
  • The client stores the time of the latest successful connectivity check, a reference to the current connectivity check task, if any, and a list of observers waiting for the result of a connectivity check

When the client is destroyed:

  • If a connectivity check task is running:
    • Cancel the connectivity check task
  • Destroy the upload workers, if any
  • Destroy the download worker, if any

When the connectivity check method is called:

  • Compare the current time to the time of the latest successful connectivity check
  • If a connectivity check has recently succeeded:
    • Notify the observer
  • Else if a connectivity check task is running:
    • Add the observer to the list of waiting observers
  • Else:
    • Add the observer to the list of waiting observers
    • Start a connectivity check task

When a connectivity check task succeeds:

  • Update the time of the latest successful connectivity check
  • Notify any waiting observers
  • Clear the list of waiting observers
Edited Mar 25, 2022 by akwizgran
Assignee
Assign to
Time tracking