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

Extract canon from registry #221

Merged
merged 1 commit into from
Dec 13, 2020

Conversation

alyjak
Copy link
Contributor

@alyjak alyjak commented Nov 23, 2020

Changes Registry to use Arc<RwLock<S: CustomEntitySerializer>

This way Canon (and other implementations of CustomEntitySerializer) can be used outside of Registry, which is useful for mapping world entities to data outside of legion. RwLock is more friedly for this use case, and requiring Send + Sync on S instead of just Send doesn't seem too burdensome.

This way `Canon` (and other implementations of `CustomEntitySerializer`) can be used outside of
Registry, which is useful for mapping world entities to data outside of legion. A shared `Canon` should
mostly need read acces, so `RwLock` is a better choice. I don't think requiring `Sync` for `S`
is too burdensome either.
@alyjak alyjak force-pushed the extract_canon_from_registry branch from 55d2c2a to ab3527f Compare November 23, 2020 18:14
@TomGillen TomGillen merged commit 2129853 into amethyst:master Dec 13, 2020
@TomGillen TomGillen added type: breaking API breaking change, will require users to change their code type: improvement An improvement or change to an existing feature labels Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: breaking API breaking change, will require users to change their code type: improvement An improvement or change to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants