jakartaee / rest

Jakarta RESTful Web Services
Other
362 stars 117 forks source link

Add a Java 9 Flow publisher as Reactive Client response body #1016

Open hantsy opened 3 years ago

hantsy commented 3 years ago

Currently, the Java 8 CompletionStage is the standard Rx client provided in Jersey. As part of Java 9 Flow, a Flow based Publisher based implementation should be provided in all providers.

WebTarget target = ClientBuilder.newClient().target("http://localhost:8080/jaxrs-async");

CompletionStage<Void> future = target.request()
    .rx(FlowPublisher.class)
    .get(String.class)
    .subscribe(t -> System.out.println(t));
mkarg commented 2 years ago

Do you like to file a PR containing all needed changes to API, spec, tests and TCK? That would be terrific! :-)