[OFREP] Add SSE event stream support
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia dalla gestione della risposta di POST /ofrep/v1/evaluate/flags/{key} e leggi ADR-0008 insieme alle modifiche alla specifica OpenAPI. Esamina launchdarkly/python-eventsource come approccio per il client SSE; il lavoro è completato quando vengono analizzate le voci supportate di eventStreams, vengono mantenute connessioni deduplicate, viene emesso PROVIDER_CONFIGURATION_CHANGED per gli eventi refetchEvaluation e vengono gestiti la riconnessione e il comportamento del timeout di inattività.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Context
ADR-0008 defines Server-Sent Events (SSE) as an optional real-time change notification mechanism for OFREP. The OpenAPI spec PR adds the corresponding eventStreams field to evaluation responses.
The OFREP provider currently does stateless per-request evaluation with no change detection. SSE support would allow the provider to receive real-time notifications when the underlying flag configuration changes and emit PROVIDER_CONFIGURATION_CHANGED events so the host application can react.
Scope
Parse the optional eventStreams array from the POST /ofrep/v1/evaluate/flags/{key} response and connect to any entries with type: "sse". On receiving a refetchEvaluation event, emit a PROVIDER_CONFIGURATION_CHANGED event.
1. Parse eventStreams and manage SSE connections (High)
- On a successful evaluation response, check for an
eventStreamsarray - For each entry with
type: "sse", resolve the connection URL from eitherurlorendpoint.origin + endpoint.requestUri - Ignore entries with unknown types for forward compatibility
- Maintain a single SSE connection (deduplicate across evaluation responses returning the same URL)
2. Handle change events (High)
- On receiving an event with
data.type: "refetchEvaluation", emitPROVIDER_CONFIGURATION_CHANGED - On SSE connection failure, continue reconnection attempts
3. Inactivity timeout (Low)
- Apply an effective
inactivityDelaySec: client override > response value > default120seconds - On timeout, close the connection; on resume, reconnect
References
- ADR-0008
- OpenAPI spec changes
- launchdarkly/python-eventsource — Python SSE client library
- Lingua principale
- Python
- Stelle
- 27
- Fork
- 33
- Merge medio
- 5h
- PR unite (30g)
- 10
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di open-feature/python-sdk-contrib
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
UnleashProvider.track has the wrong signature: client.track raises TypeError instead of no-op Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
open-feature/python-sdk-contrib#417 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
Tutte le issue di open-feature/python-sdk-contrib
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
stephrobert/dsoxlab#238 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
sublimehq/package_control#1780 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
nwg-piotr/nwg-displays#145 ·