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

allow parent data containers to be accessed from child scopes #1486

Merged
merged 1 commit into from
May 9, 2020

Conversation

robjtede
Copy link
Member

@robjtede robjtede commented May 3, 2020

ServiceRequest::set_data_container now adds to an array of Rc<Extensions>s and lookups reverse iterate to find the closest app data of that type.

Adds the tinyvec dependency to keep a small set of references to data containers on the stack, up to 4 data containers, which should cover most use cases optimally.

src/service.rs Outdated Show resolved Hide resolved
inner.app_data = self.data.clone();
inner.app_data.push(self.data.clone());
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not 100% clear on the purpose and lifecycle of the request pool so not sure if this should be .app_data.push(...) or .app_data = tiny_vec![...].

Copy link
Member

Choose a reason for hiding this comment

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

I think the current is fine.

@robjtede robjtede marked this pull request as ready for review May 3, 2020 22:27
@robjtede robjtede requested review from a team May 3, 2020 22:27
Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me. So, I think it's fine to try this in our next alpha release.

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