FasterXML/jackson-core

document JsonRecyclerPools.sharedBoundedPool()

pjfanning opened this issue · 1 comments

  • 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?

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.