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
Provide automatic background eviction of pooled objects #86
Comments
I think that makes sense, but I decided against adding such a reaper thread in the first release to avoid adding complexity until proven necessary. There would also probably be a challenge in avoiding a "stop the world" aspect to a reaper thread while ensuring evicted resources are not passed to a pending |
Challenge: the current implementation stores idle elements in a lock-free MPSC unbounded |
This commit adds an option for background eviction of resources in case no activity is registered on the pool. Note that the background eviction is best effort, and will back off if there are concurrent release / acquire activity. The later actually checks the eviction predicate too, which allows for some amount of eviction to occur even if the background task has backed off.
This commit adds an option for background eviction of resources in case no activity is registered on the pool. Note that the background eviction is best effort, and will back off if there are concurrent release / acquire activity. The later actually checks the eviction predicate too, which allows for some amount of eviction to occur even if the background task has backed off.
This commit adds an option for background eviction of resources in case no activity is registered on the pool. Note that the background eviction is best effort, and will back off if there are concurrent release / acquire activity. The later actually checks the eviction predicate too, which allows for some amount of eviction to occur even if the background task has backed off.
This suggestion comes from r2dbc-pool perspective: it would be nice to have something running in background in reactor-pool to evict objects after their TTL.
More context in this r2dbc-pool issue:
r2dbc/r2dbc-pool#6
The text was updated successfully, but these errors were encountered: