-
Notifications
You must be signed in to change notification settings - Fork 538
feat: Adding support for SSE on the WebClient #2794
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
base: master
Are you sure you want to change the base?
Conversation
a38c5e7 to
458fc76
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need for now
- at least 1 integration test with WebClient
- SseBodyCodec and tests should be in vertx-web-common package instead where BodyCodec is
4efdb3b to
fdd4b43
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fdd4b43 to
2087406
Compare
|
@tsegismont maybe I could make the SseEvent toString to acutally create a 'valid'SSE string with the new lines |
b232c03 to
fddd3ac
Compare
vertx-web-common/src/main/java/io/vertx/ext/web/codec/sse/SseBodyCodec.java
Outdated
Show resolved
Hide resolved
vertx-web-client/src/test/java/io/vertx/ext/web/client/tests/SseClientTest.java
Outdated
Show resolved
Hide resolved
vertx-web-common/src/main/java/io/vertx/ext/web/codec/sse/SseBodyCodec.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few changes
vertx-web-client/src/test/java/io/vertx/ext/web/client/tests/SseClientTest.java
Show resolved
Hide resolved
vertx-web-common/src/main/java/io/vertx/ext/web/codec/sse/SseBodyCodec.java
Outdated
Show resolved
Hide resolved
vertx-web-common/src/main/java/io/vertx/ext/web/codec/sse/SseBodyCodec.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @ehsavoie ! This looks great already. I think we need to make the new objects Vert.x API objects (annotated with @VertxGen or @DataObject).
Otherwise, they won't be available in generated bindings.
That might require a bit of refactoring, you can inspire from other codecs, like BodyCodec.
vertx-web-common/src/main/java/io/vertx/ext/web/codec/sse/SseBodyCodec.java
Show resolved
Hide resolved
vertx-web-common/src/main/java/io/vertx/ext/web/codec/sse/SseEvent.java
Outdated
Show resolved
Hide resolved
9274840 to
5164652
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the updates @ehsavoie !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @ehsavoie !
vertx-web/src/test/java/io/vertx/ext/web/tests/sse/SseBodyCodecTest.java
Show resolved
Hide resolved
vertx-web-common/src/main/java/io/vertx/ext/web/codec/SseEvent.java
Outdated
Show resolved
Hide resolved
vertx-web-common/src/main/java/io/vertx/ext/web/codec/BodyCodec.java
Outdated
Show resolved
Hide resolved
vertx-web-common/src/main/java/io/vertx/ext/web/codec/impl/SseBodyCodec.java
Outdated
Show resolved
Hide resolved
vertx-web-common/src/main/java/io/vertx/ext/web/codec/impl/SseBodyCodec.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for not moving the test from web-common to web-client?
Signed-off-by: Emmanuel Hugonnet <[email protected]>
Signed-off-by: Emmanuel Hugonnet <[email protected]>
|
@tsegismont I've move the test |
Motivation:
I needed to be able to process SSE events on the client side.
Conformance:
You should have signed the Eclipse Contributor Agreement as explained in https://github.com/eclipse/vert.x/blob/master/CONTRIBUTING.md
Please also make sure you adhere to the code style guidelines: https://github.com/vert-x3/wiki/wiki/Vert.x-code-style-guidelines