A simple pool library for Java
- support concurrency use for objects.
- jdk1.8 only
Pool<MyObject> pool = ConcurrencyAwarePool.<MyObject> builder()
.destroy(MyObject::close)
.maxSize(30)
.minIdle(1)
.evaluatePeriod(ofSeconds(2))
.simpleThresholdStrategy(10, 0.8)
.build(MyObject::new);
MyResult myResult = pool.supply(myObject-> myObject.doSomething());