Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[OFREP] Add SSE event stream support

Đang mở
#366 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
api, backend

Hướng nghiên cứu

Bắt đầu với việc xử lý phản hồi của POST /ofrep/v1/evaluate/flags/{key} và đọc ADR-0008 cùng với các thay đổi trong đặc tả OpenAPI. Xem xét launchdarkly/python-eventsource làm cách tiếp cận cho ứng dụng khách SSE; công việc được xem là hoàn tất khi phân tích các mục eventStreams được hỗ trợ, duy trì các kết nối đã loại bỏ trùng lặp, phát PROVIDER_CONFIGURATION_CHANGED cho các sự kiện refetchEvaluation, đồng thời xử lý việc kết nối lại và hành vi của thời gian chờ không hoạt động.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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 eventStreams array
  • For each entry with type: "sse", resolve the connection URL from either url or endpoint.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", emit PROVIDER_CONFIGURATION_CHANGED
  • On SSE connection failure, continue reconnection attempts
3. Inactivity timeout (Low)
  • Apply an effective inactivityDelaySec: client override > response value > default 120 seconds
  • On timeout, close the connection; on resume, reconnect

References

Ngôn ngữ chính
Python
Star
27
Fork
33
Merge trung bình
11 giờ 10 phút
Pull request đã merge (30 ngày)
14

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của open-feature/python-sdk-contrib

Tất cả issue của open-feature/python-sdk-contrib

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.