Skip to content

Commit 6fbac15

Browse files
author
Tapio Rautonen
committed
iluwatar#68: Documented async method invocation.
1 parent 5cc83b8 commit 6fbac15

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ Concurrency patterns are those types of design patterns that deal with the multi
7171

7272
* [Double Checked Locking](#double-checked-locking)
7373
* [Thread Pool](#thread-pool)
74+
* [Async Method Invocation](#async-method-invocation)
7475

7576
### Presentation Tier Patterns
7677

@@ -619,6 +620,18 @@ validation and for building to order
619620
**Applicability:** Use the Thread Pool pattern when
620621
* You have a large number of short-lived tasks to be executed in parallel
621622

623+
## <a name="async-method-invocation">Async Method Invocation</a> [&#8593;](#list-of-design-patterns)
624+
**Intent:** Asynchronous method invocation is pattern where the calling thread is not blocked while waiting results of tasks. The pattern provides parallel processing of multiple independent tasks and retrieving the results via callbacks or waiting until everything is done.
625+
626+
**Applicability:** Use async method invocation pattern when
627+
* You have multiple independent tasks that can run in parallel
628+
* You need to improve performance of running a group of sequential tasks
629+
* You have limited number of processing capacity or long running tasks and the caller cannot wait the tasks to be ready
630+
631+
**Real world examples:**
632+
* [FutureTask](http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/FutureTask.html), [CompletableFuture](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html) and [ExecutorService](http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html) (Java)
633+
* [Task-based Asynchronous Pattern](https://msdn.microsoft.com/en-us/library/hh873175.aspx) (.NET)
634+
622635
## <a name="private-class-data">Private Class Data</a> [&#8593;](#list-of-design-patterns)
623636
**Intent:** Private Class Data design pattern seeks to reduce exposure of attributes by limiting their visibility. It reduces the number of class attributes by encapsulating them in single Data object.
624637

0 commit comments

Comments
 (0)