Skip to content

Commit

Permalink
added javadocs, v4.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
sitfoxfly committed Nov 12, 2019
1 parent 369a4a2 commit a2ff673
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
4 changes: 3 additions & 1 deletion checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@

<!-- Checks whether files end with a new line. -->
<!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
<module name="NewlineAtEndOfFile"/>
<module name="NewlineAtEndOfFile">
<property name="lineSeparator" value="lf"/>
</module>

<!-- Checks that property files contain the same keys. -->
<!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/ai/preferred/venom/fetcher/AsyncFetcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,25 @@ public final class AsyncFetcher implements Fetcher {
*/
private final boolean compressed;

/**
* Creates {@link BasicFuture} and fails the request with a specified exception.
*
* @param callback request callback
* @param ex specified exeption
* @return BasicFuture created
*/
private static Future<Response> failRequest(final FutureCallback<Response> callback, final Exception ex) {
final BasicFuture<Response> f = new BasicFuture<>(callback);
f.failed(ex);
return f;
}

/**
* Creates {@link BasicFuture} and cancels the request.
*
* @param callback request callback
* @return BasicFuture created
*/
private static Future<Response> cancelRequest(final FutureCallback<Response> callback) {
final BasicFuture<Response> f = new BasicFuture<>(callback);
f.cancel(true);
Expand Down

0 comments on commit a2ff673

Please sign in to comment.