-
-
Notifications
You must be signed in to change notification settings - Fork 27.3k
Added FanOut/FanIn Pattern #1787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
iluwatar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
fanout-fanin/README.md
Outdated
| @@ -0,0 +1,33 @@ | |||
| --- | |||
| layout: pattern | |||
| title: FanOut-FanIn | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| title: FanOut-FanIn | |
| title: Fan-Out/Fan-In |
fanout-fanin/README.md
Outdated
| title: FanOut-FanIn | ||
| folder: fanout-fanin | ||
| permalink: /patterns/fanout-fanin/ | ||
| categories: Concurrency |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| categories: Concurrency | |
| categories: Integration |
fanout-fanin/README.md
Outdated
| - Cloud distributed | ||
| - Performance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - Cloud distributed | |
| - Performance | |
| - Microservices |
fanout-fanin/README.md
Outdated
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The term activity function is not self-explanatory. Could we perhaps talk about microservices?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also explain how the caller eventually gets the aggregated result.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need an explanation section and some of the details could be placed there.
fanout-fanin/README.md
Outdated
| ## 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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