Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jaxrs-dev] [Proposal] Provide another non blocking open() in EventSource

If understand the EventSource#open() correctly, it should wait the connection is established and return. 

/*
 * Open the connection to the supplied SSE underlying {@link WebTarget web target} and start processing incoming
 * {@link InboundSseEvent events}.
 *
 * @throws IllegalStateException in case the event source has already been opened earlier.
 */
void open();

There is already error consumer can be registered to EventSource and user can get exception thrown from open() with that handler.
We can provide another non-blocking open method and allow user not to wait the connection and do the following things like send another request :

eventSource.open(nonBlocking); 
client.target("http://foo.bar/test").request().post(Entity.entity("msg", MediaType.TEXT_PLAIN_TYPE));

WDYT ?

Cheers,
Jim

Back to the top