Add generic server-sent events support to Azure Core - #50146
Closed
Xiaofei Cao (XiaofeiCao) wants to merge 6 commits into
Closed
Add generic server-sent events support to Azure Core#50146Xiaofei Cao (XiaofeiCao) wants to merge 6 commits into
Xiaofei Cao (XiaofeiCao) wants to merge 6 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: ff0a367c-664e-4de0-902b-ddaae2c86546
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: ff0a367c-664e-4de0-902b-ddaae2c86546
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: daa3657a-91d5-48fa-b7ae-6983091cab6a
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: daa3657a-91d5-48fa-b7ae-6983091cab6a
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: daa3657a-91d5-48fa-b7ae-6983091cab6a
Bound incomplete server-sent events to 16 MiB and retain multi-line data in a single buffer to prevent unbounded heap growth. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 1 pipeline(s). 34 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds minimal, single-response server-sent events support to
azure-core, based on #50081.ServerSentEvent<T>,ServerSentEventListener<T>, andServerSentEventStreamsfor synchronous listener and asynchronousFluxconsumption.text/event-streamresponses and supports optional service-defined terminal-event predicates.Response<BinaryData>implementation for streaming responses.HttpLoggingPolicyfrom buffering SSE response bodies.Scope
This PR intentionally handles one established HTTP response. It does not reconnect, replay requests, or send
Last-Event-Id. Search client APIs, generated models, and emitter work remain separate.Contract
Response overloads require a closeable HTTP 200 or 204 response. Non-204 responses require exactly one
text/event-streamcontent type and reject an explicit non-UTF-8 charset. Existing overloads complete on EOF or HTTP 204; predicate overloads require and inclusively deliver a matching terminal event.Validation
azure-coretest suite: 11,881 tests, 0 failures, 3 skipped