Repository navigation
feat: 优化 SSE emitter 基础能力 - #48
Merged
Merged
Conversation
- 新增 AbstractEmitter,统一 send/comment/retry/close 与帧归一化 - EmitterInterface 支持 object 事件数据 - SseResponse 增加 emit(),允许注入自定义 emitter - 补齐 object 和注入 emitter 测试
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.
变更
优化 SSE emitter 的公共能力:
AbstractEmitter,统一send、comment、retry、close和帧归一化EmitterInterface::send()支持object事件数据SseResponse::emit(EmitterInterface)允许注入自定义 emitter设计
write()SseResponse::send()继续作为 CGI 入口,内部委托emit()emit()复用生产者与错误处理兼容性
EmitterInterface::send()的参数类型从Event|string|array放宽为string|array|object。自定义 emitter 实现需要同步放宽参数类型;现有调用方兼容。验收