We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 50f49b9 commit fd79a6eCopy full SHA for fd79a6e
1 file changed
src/main/java/fr/sandro642/github/example/ExampleUsages.java
@@ -80,12 +80,14 @@ public void exampleMethodAsync() {
80
);
81
82
// Handle the response when it completes
83
- ApiFactory response = futureResponse.get();
+ ApiFactory response = futureResponse.get(10, TimeUnit.SECONDS);
84
85
System.out.println(response.display());
86
System.out.println("Response Code: " + response.getData("code"));
87
System.out.println("Response Message: " + response.getData("message"));
88
System.out.println("Response Data: " + response.getSpecData("data", "exampleKey"));
89
+ } catch (java.util.concurrent.TimeoutException e) {
90
+ System.err.println("The operation timed out: " + e.getMessage());
91
} catch (Exception e) {
92
e.printStackTrace();
93
}
0 commit comments