reactor/reactor-pool

Inconsistent Builder sizeMin(…).sizeMax(…) behavior

mp911de opened this issue · 3 comments

Expected behavior

Calling PoolBuilder.sizeMin(min).sizeMax(max) should retain min and max values.

Actual behavior

Calling PoolBuilder.sizeMin(min).sizeMax(max) discards min-value and requires calling sizeBetween(…).

This behavior isn't obvious from method naming and Javadoc also does not reflect the current behavior.

Reactor Pool version

0.0.1.M3

In the "Expected behavior", It should retain max value

It is going to be breaking but I think the better course is to only keep sizeBetween(int min, int max) and sizeUnbounded(). Most of the time the max bound will be the interesting one, so the worst usability case where one only needs amin and thus would need to use Integer.MAX_VALUE as the max is least likely.

I'll also clarify that these two are actually equivalent to calling allocationStrategy(AllocationStrategy) in the background so all 3 methods are mutually exclusive.