Skip to content

Commit

Permalink
fix async
Browse files Browse the repository at this point in the history
Signed-off-by: David Chan <chdavid@ca.ibm.com>
  • Loading branch information
Channyboy authored and jmartisk committed Feb 4, 2020
1 parent 59003cb commit e8296b4
Showing 1 changed file with 4 additions and 5 deletions.
Expand Up @@ -227,18 +227,17 @@ public String getNameObject(@QueryParam("qp1") NameObject v1) throws Exception

@GET
@Path("/get-async")
public void getAsync(@Suspended final AsyncResponse ayncResponse) throws Exception {
public void getAsync(@Suspended final AsyncResponse asyncResponse) throws Exception {
Thread thread = new Thread ( () -> {
try {
Thread.sleep(5000);
}
asyncResponse.resume("This is a GET request with AsyncResponse");
}
catch (Exception e) {
System.err.println(e.toString());
}
});
thread.run();

ayncResponse.resume("This is a GET request with AsyncResponse");
thread.start();
}


Expand Down

0 comments on commit e8296b4

Please sign in to comment.