Skip to content

event cache: unload the pinned event cache at the appropriate time #6179

@bnjbvr

Description

@bnjbvr

The new PinnedEventCache introduced recently is spawned lazily. It will spawn a task in the background as well, that will be correctly aborted when the parent container struct is dropped. However, there's nothing signaling, at the moment, that all pinned Timelines are dead, and that the PinnedEventCache could be unloaded (i.e. the task could be aborted), resulting in unnecessary background processing, after an app has switched the view away from the pinned events timeline.

  • We could likely reuse and generalize the mechanism introduced for the unthreaded room timeline (née RoomEventCacheSubscriber, which name would have to be generalized).
  • Alternatively, we could also just count pinned timelines as observers of the main room timeline — which make sense, since a pinned event timeline requires the unthreaded timeline to be alive and updated over time. Then, when the RoomEventCacheSubscriber drops, we could also unload the PinnedEventCache.
  • (other million dollars idea goes here)

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions