Added FanOut/FanIn Pattern#1787
Conversation
iluwatar
left a comment
There was a problem hiding this comment.
Thanks for implementing this pattern. Looks good in general. I added some improvement requests, please take a look and let us know when you're ready for another review.
| @@ -0,0 +1,33 @@ | |||
| --- | |||
| layout: pattern | |||
| title: FanOut-FanIn | |||
There was a problem hiding this comment.
| title: FanOut-FanIn | |
| title: Fan-Out/Fan-In |
| title: FanOut-FanIn | ||
| folder: fanout-fanin | ||
| permalink: /patterns/fanout-fanin/ | ||
| categories: Concurrency |
There was a problem hiding this comment.
| categories: Concurrency | |
| categories: Integration |
| - Cloud distributed | ||
| - Performance |
There was a problem hiding this comment.
| - Cloud distributed | |
| - Performance | |
| - Microservices |
| The pattern that refers to executing multiple instances of the activity function concurrently. Generally "FanOut" | ||
| process is splitting the data into multiple chunks that would be passed to the activity function. "FanIn" process is | ||
| basically aggregating the result from individual instance of activity function and forming a single final result. <br /> | ||
|
|
||
| Each activity function is a long-running process that takes in a chunk of data. A callback function, or a Consumer | ||
| is passed to the activity function, that will be called when the long-running process gets over. The consumer will | ||
| process the individual return value from activity function as they are done running into a final result. |
There was a problem hiding this comment.
The term activity function is not self-explanatory. Could we perhaps talk about microservices?
There was a problem hiding this comment.
We should also explain how the caller eventually gets the aggregated result.
There was a problem hiding this comment.
We need an explanation section and some of the details could be placed there.
| ## Applicability | ||
|
|
||
| Use this pattern when you can chunk the workload or load into multiple chunks that can be dealt with separately. | ||
|
|
There was a problem hiding this comment.
I think we could add a related patterns section, see https://github.com/iluwatar/java-design-patterns/wiki/02.-Pattern-template. Some of the microservices patterns we already have seemed to be quite similar.
|
Kudos, SonarCloud Quality Gate passed! |
|
@karthikbhat13 I'm not sure what has happened, but the PR doesn't have any changed files anymore. Can you please take a look at it? |
|
Oh, didn't notice that. Lemme check. There is a hook to auto pull master branch to base repo. It probably replaced my branch. I will update again. |
|
@karthikbhat13 either way, but please ensure that you have addressed my earlier review comments. |
@iluwatar Have done that. I have fixed the comments and added the explanation and related patterns sections. 1948342 of #1799 |
|
Ok, let's continue the process in #1799. |
FanOut/FanIn Pattern
Pull request description