Skip to content
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

lib: refactor to use mapping in cluster master #36250

Merged
merged 1 commit into from
Jan 10, 2021

Conversation

yashLadha
Copy link
Contributor

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the cluster Issues and PRs related to the cluster subsystem. label Nov 24, 2020
else if (message.act === 'close')
close(worker, message);
else if (fn)
fn(worker, message);
}

function online(worker) {
Copy link
Contributor

@mscdex mscdex Nov 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we just added message to the signature here (to appease V8's JIT) and then treated online() as the same as the other methods in onmessage() to simplify things completely?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense actually 👍 reason for not doing this was the second argument passed will be unused, so if it is not of concern i can make the changes.

@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Dec 29, 2020
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 29, 2020
@aduh95 aduh95 added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 3, 2021
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 3, 2021
@nodejs-github-bot
Copy link
Collaborator

@aduh95
Copy link
Contributor

aduh95 commented Jan 6, 2021

@yashLadha can you rebase to fix the conflict please?

@aduh95 aduh95 removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 6, 2021
@yashLadha yashLadha force-pushed the chore_refactor_cluster_master branch from 3acfccb to 452491f Compare January 6, 2021 15:26
@yashLadha yashLadha added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 7, 2021
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 7, 2021
@nodejs-github-bot
Copy link
Collaborator

@aduh95 aduh95 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 7, 2021
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

Cluster master message handler is basically doing the same thing for
different message actions which can be avoided. Thus move to method
mapping object and doing a single lookup to find the function to execute
and it doesnot exists, skip the execution chain.

PR-URL: nodejs#36250
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@aduh95 aduh95 force-pushed the chore_refactor_cluster_master branch from 452491f to 88d8dde Compare January 10, 2021 11:51
@aduh95
Copy link
Contributor

aduh95 commented Jan 10, 2021

Landed in 88d8dde

@aduh95 aduh95 merged commit 88d8dde into nodejs:master Jan 10, 2021
danielleadams pushed a commit that referenced this pull request Jan 12, 2021
Cluster master message handler is basically doing the same thing for
different message actions which can be avoided. Thus move to method
mapping object and doing a single lookup to find the function to execute
and it doesnot exists, skip the execution chain.

PR-URL: #36250
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. cluster Issues and PRs related to the cluster subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants