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

Add PagePool.MustGet, modify Get method allow error return rather recover panic. #1049

Closed
wants to merge 1 commit into from

Conversation

zeoxisca
Copy link
Contributor

PagePool

The PagePool.Get can now only accept create func() *Page as input, so there is no way to output the error that may exist in the create func other than using a closure, and it is inconvenient for users in a multi-routine environment to perform logical processing based on the actual error that occurred.

However, I'm not sure whether this change would be in line with the original design.

By the way, PagePool.CleanUp may stuck while pp is not full. I also think this might be an issue when using PagePool.

@zeoxisca zeoxisca changed the title Move PagePool.Get to MustGet, add Get method allow error return to prevent panic. Move PagePool.Get to MustGet, add Get method allow error return rather recover panic. Apr 30, 2024
@zeoxisca zeoxisca changed the title Move PagePool.Get to MustGet, add Get method allow error return rather recover panic. Add PagePool.MustGet, modify Get method allow error return rather recover panic. Apr 30, 2024
@zeoxisca zeoxisca closed this Apr 30, 2024
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.

None yet

1 participant