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

document JsonRecyclerPools.sharedBoundedPool() #1240

Open
pjfanning opened this issue Mar 14, 2024 · 1 comment
Open

document JsonRecyclerPools.sharedBoundedPool() #1240

pjfanning opened this issue Mar 14, 2024 · 1 comment

Comments

@pjfanning
Copy link
Member

pjfanning commented Mar 14, 2024

  • JsonRecyclerPools.newBoundedPool(int) takes a bounded queue size
  • JsonRecyclerPools.sharedBoundedPool() takes no value for the bounded queue size - and the GLOBAL instance seems to have a bound of 100
  • is it possible that we could document the behaviour of the JsonRecyclerPools.sharedBoundedPool()? -- including what happens when the bound is reached
  • could we add sharedBoundedPool(int) where users choose the size?
@cowtowncoder
Copy link
Member

Ok so yes:

  1. When bound is reached, no more instances should be pooled (i.e. on returning a lease, buffer instance is just dropped)
  2. The whole idea of sharedBoundedPool() is to be global, non-configurable, instance -- so I am not sure how it'd work when multiple factories tried to get shared instance with different configuration.

I guess partly this is due to connotations of "shared" -- I went back and forth between "global" and "shared". It really means "global"; and not something constructed on-demand for sharing. It's a global singleton.

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

No branches or pull requests

2 participants