Skip to content

Commit 665dc70

Browse files
committed
iluwatar#107 Half-Sync Half-Async example JavaDoc
1 parent c5c4a68 commit 665dc70

File tree

2 files changed

+16
-0
lines changed
  • half-sync-half-async/src
    • main/java/com/iluwatar/halfsynchalfasync
    • test/java/com/iluwatar/halfsynchalfasync

2 files changed

+16
-0
lines changed

half-sync-half-async/src/main/java/com/iluwatar/halfsynchalfasync/App.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.concurrent.LinkedBlockingQueue;
44

55
/**
6+
*
67
* This application demonstrates Half-Sync/Half-Async pattern. Key parts of the pattern are
78
* {@link AsyncTask} and {@link AsynchronousService}.
89
*
@@ -44,9 +45,14 @@
4445
* Such as Priority Queue can be used as queuing layer to prioritize the way tasks are executed.
4546
* Our implementation is just one simple way of implementing this pattern, there are many variants possible
4647
* as described in its applications.
48+
*
4749
*/
4850
public class App {
4951

52+
/**
53+
* Program entry point
54+
* @param args command line args
55+
*/
5056
public static void main(String[] args) {
5157
AsynchronousService service = new AsynchronousService(new LinkedBlockingQueue<>());
5258
/*
@@ -66,6 +72,11 @@ public static void main(String[] args) {
6672
service.execute(new ArithmeticSumTask(1));
6773
}
6874

75+
/**
76+
*
77+
* ArithmeticSumTask
78+
*
79+
*/
6980
static class ArithmeticSumTask implements AsyncTask<Long> {
7081
private long n;
7182

half-sync-half-async/src/test/java/com/iluwatar/halfsynchalfasync/AppTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
import org.junit.Test;
66

7+
/**
8+
*
9+
* Application test
10+
*
11+
*/
712
public class AppTest {
813

914
@Test

0 commit comments

Comments
 (0)