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

ServerSentEventEncoder does not produce valid output #141

Closed
tbak opened this issue Jun 15, 2014 · 1 comment
Closed

ServerSentEventEncoder does not produce valid output #141

tbak opened this issue Jun 15, 2014 · 1 comment
Labels
Milestone

Comments

@tbak
Copy link
Collaborator

tbak commented Jun 15, 2014

RxNetty's SSE encoder does not produce valid output. If you look at spec (http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#event-stream-interpretation), the ServerSentEventDecoder is pretty close following it. So for example if we get on the wire

event: add
data: something
id: 1

It will be mapped to ServerSentEvent object ServerSentEvent("1", "add", "something").

However the encoder will just produce for such event just one line of this kind:

add: something

And small naming improvement - eventName is described as eventType in the spec.

@NiteshKant
Copy link
Member

cc @g9yuayon

@tbak makes sense to me.

So, this is what I understand which should be possible

  • Write an event with id, name and data (as it is today) which writes this on the wire
event: <name>
data: <data>
id: <id>
  • Write an event with only name and data which writes this on the wire
event: <name>
data: <data>
  • Write an event with only id and data which writes this on the wire
data: <data>
id: <id>
  • Write an event with only data which writes this on the wire:
data: <data>

The usecase of above would predominantly be to send multiple data attributes per event name or event name + id combination.

@NiteshKant NiteshKant added the bug label Jun 16, 2014
@tbak tbak closed this as completed in 5eca246 Jun 30, 2014
NiteshKant added a commit that referenced this issue Jun 30, 2014
@NiteshKant NiteshKant added this to the 0.3.7 milestone Jun 30, 2014
@tbak tbak removed their assignment Aug 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants