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.
PagePool
The
PagePool.Get
can now only acceptcreate 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 whilepp
is not full. I also think this might be an issue when using PagePool.