/simple-pool

A simple Java pool that supports customized ref counting.

Primary LanguageJavaThe UnlicenseUnlicense

simple-pool

Build Status Coverage Status Total alerts Language grade: Java Maven Central

A simple pool library for Java

  • support concurrency use for objects.
  • jdk1.8 only

Get Started

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());