Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSE API is error prone, and lacks flexibility for common usage patterns #222

Closed
tbak opened this issue Sep 4, 2014 · 1 comment
Closed
Assignees
Milestone

Comments

@tbak
Copy link
Collaborator

tbak commented Sep 4, 2014

Following #220 issue discussion, here is a list of improvements for SSE:

  • make ServerSentEvent objects creation more flexible:
    • add single argument constructor to ServerSentEvent class with data content, or
    • add static factory methods to ServerSentEvent(ServerSentEvent.sseData(String data), ServerSentEvent.sseWithType(String eventType, String data), etc)
  • accept String object in SSE encoder, which is interpreted as data field value
@tbak tbak mentioned this issue Sep 4, 2014
NiteshKant pushed a commit to NiteshKant/RxNetty that referenced this issue Nov 3, 2014
ReactiveX#205 (Move SSE related classes to http): This is a new implementation of SSE for some optimizations and spec compliance.
ReactiveX#209 (Deprecated all SSE classes in text pkg): SSE is only applicable to HTTP.
ReactiveX#220 (SSE Output confusion): Default case only emits data event.
ReactiveX#222 (Improved SSE API): Better construction semantics.
ReactiveX#30 (Optimized SSE decoder): Rewrite of the existing decoder.
@NiteshKant
Copy link
Member

PR #266 reimplements SSE in the package io.reactivex.netty.protocol.http.sse and the following are the primary changes w.r.t this issue:

  • Default ServerSentEvent constructor only emits a single data event.
  • ServerSentEvent class provides three create methods withEventIdAndType, withEventType and withEventId to create events with eventId and eventType.
  • Verified that one can directly write a string on an HttpServer configured to write SSE. This can be done using HttpServerResponse.writeString() method.
  • Added another method HttpServerResponse.writeBytes() to also write a ByteBuf

@NiteshKant NiteshKant added this to the 0.3.17 milestone Nov 3, 2014
@NiteshKant NiteshKant self-assigned this Nov 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants