moq-net: expose a per-registration token matching a resolved broadcast to its route event

Aperta
#10,390 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
api, backend

Direzione di ricerca

Start by reading the definitions of RouteEvent, Announce, RouteInfo::epoch, and broadcast::Info, then trace how route registrations and resolved consumers are created. Work out where one local token can be assigned per registration and carried through both public APIs, including same-identity reconnects. Done means consumers and route events expose matching opaque tokens that distinguish registrations without implying ordering across identities.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

quest

Problem

An application that follows an origin's routes (RouteEvent) and separately resolves the broadcasts at those paths cannot tell which route registration a resolved broadcast::Consumer belongs to. Each re-registration of a path, including a publisher reconnecting under the same identity, gets a new incarnation (RouteInfo::epoch), but that field is pub(crate) and nothing public carries an equivalent: RouteEvent has kind and announce, and broadcast::Info has no per-registration id.

So an application that keeps per-registration state (for example, an id it mints on each route start and attaches to work it does on that broadcast) has to pair the two by event order across cursors. That is exact in the common case but not by construction: if two registrations of one path come and go between two turns of the application's loop, a broadcast from the earlier registration can be paired with the later one's state.

Ask

Expose an opaque, local (never on the wire) per-registration token that:

  • is distinct for every registration of a path, including same-identity reconnects that today arrive as an in-place change;
  • is available both on the route event (or its Announce) and on the resolved broadcast (broadcast::Info or the consumer), so the two match exactly;
  • carries no ordering or meaning across identities, matching how epoch is used today.

Exposing epoch as-is would not be enough on its own, since it orders incarnations of one identity only and a token needs to tell registrations of different identities apart too.

(Written by Claude Opus 5.5 with high)

Lingua principale
Rust
Stelle
1.6k
Fork
251
Merge medio
10h 10m
PR unite (30g)
822

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di moq-dev/moq

Tutte le issue di moq-dev/moq

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.