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

Refactor: Decouples player view calculation from Server's Master #966

Merged
merged 6 commits into from
Jul 27, 2021
Merged

Refactor: Decouples player view calculation from Server's Master #966

merged 6 commits into from
Jul 27, 2021

Conversation

vdfdev
Copy link
Contributor

@vdfdev vdfdev commented Jul 26, 2021

In this PR I refactor the interface between Master and Transport, so the Master will only send a single message to the transport, and then the transport will calculate the player view for each player.

This will allow us to use a pub/sub to propagate the Master message, allowing us to scale the bgio server horizontally.

Checklist

  • Use a separate branch in your local repo (not main).
  • Test coverage is 100% (or you have a story for why it's ok).

@vdfdev vdfdev requested a review from delucis July 26, 2021 01:16
Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

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

This looks like a good way to untangle these — good work!

We also need to account for the sync action, but otherwise this looks ready to go.

src/server/transport/socketio.ts Show resolved Hide resolved
src/master/master.ts Outdated Show resolved Hide resolved
@vdfdev vdfdev requested a review from delucis July 27, 2021 04:50
Copy link
Contributor Author

@vdfdev vdfdev left a comment

Choose a reason for hiding this comment

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

Comments addressed

@delucis delucis merged commit 262d867 into boardgameio:main Jul 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants