Skip to content

SessionRegistry: on_resume_filter to purge stale events queued while detached #229

Description

@aaylward

From muchq/MoonBase#1590 (games_hub voice signaling), opal-cpp note 3. Nice to have.

With Options::queue_while_detached, everything queued during grace is delivered on Resume. Some of it is stale by then. For example, WebRTC signaling for peer connections that no longer exist. There is no way to shed it short of not queuing it at all.

Proposal

Options::on_resume_filter, a std::function<bool(const Tx&)> that runs over the retained queue at Resume and returns true to keep an event. Unset means today's behaviour.

games_hub avoids needing this by ending voice on Detach, so this is low priority. If #227 (delivery classes) lands, consider whether a class-based rule ("droppable events don't survive detach") covers this instead of a separate callback.

Tests

  • A filter that rejects one event kind: after Resume, only the other kinds are delivered, in order.
  • Unset filter: every retained event is delivered, same as today.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions