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

Incorrect method in the documentation #3720

Open
jerseyrobot opened this issue Nov 20, 2017 · 1 comment
Open

Incorrect method in the documentation #3720

jerseyrobot opened this issue Nov 20, 2017 · 1 comment

Comments

@jerseyrobot
Copy link
Contributor

Hi

I followed this guide: https://jersey.github.io/documentation/latest/sse.html and this code example:

@GET
    @Produces(MediaType.SERVER_SENT_EVENTS)
    public void getServerSentEvents(@Context SseEventSink eventSink, @Context Sse sse) {
        new Thread(() -> {
            for (int i = 0; i < 10; i++) {
                // ... code that waits 1 second
                final OutboundSseEvent event = sse.newEventBuilder()
                    .name("message-to-client")
                    .data(String.class, "Hello world " + i + "!")
                    .build();
                eventSink.onNext(event);
            }
        }).start();
    }

However it seems to be outdated as eventSink doesn't have onNext method now. The replacement is send method that does the same.

@jerseyrobot
Copy link
Contributor Author

mcserra added a commit to mcserra/jersey that referenced this issue Jan 28, 2020
Signed-off-by: Miguel Serra <Miguel.Serra@criticaltechworks.com>
mcserra added a commit to mcserra/jersey that referenced this issue Feb 2, 2020
Signed-off-by: Miguel Serra <Miguel.Serra@criticaltechworks.com>
senivam pushed a commit that referenced this issue Feb 11, 2020
* [#3720] Incorrect method in the documentation

Signed-off-by: Miguel Serra <Miguel.Serra@criticaltechworks.com>
jansupol pushed a commit to jansupol/jersey that referenced this issue Mar 23, 2020
…4j#4378)

* [eclipse-ee4j#3720] Incorrect method in the documentation

Signed-off-by: Miguel Serra <Miguel.Serra@criticaltechworks.com>
(cherry picked from commit 780b754)
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

1 participant