April 2018
Intermediate to advanced
382 pages
10h 11m
English
We started with our SSE engine, the ServerEvent class, and a JAX-RS endpoint—these hold all the methods that we need for this recipe.
Let's understand the first one:
@Path("start") @POST public Response start(@Context Sse sse) { final UserEvent process = new UserEvent(sse); POOL.put(process.getId(), process); executor.submit(process); final URI uri = UriBuilder.fromResource(ServerSentService.class). path("register/{id}").build(process.getId()); return Response.created(uri).build(); }
Following are the main points:
Read now
Unlock full access