Skip to content
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

Split metadata out of PooledRef #11

Closed
simonbasle opened this issue Feb 15, 2019 · 1 comment
Closed

Split metadata out of PooledRef #11

simonbasle opened this issue Feb 15, 2019 · 1 comment
Milestone

Comments

@simonbasle
Copy link
Member

PooledRef should only directly expose the methods that are most relevant to the majority of users: release(), invalidate() (to a lesser extent, but that's the logical place to put it) and poolable().

Additional methods that return metrics about the PooledRef should be hidden away in a separate interface. Since these can be viewed as metadata for the reference (which could grow beyond simple metrics to include some state), I suggest PooledRefMetadata.

The metadata would be accessible through a fourth method, PooledRef#metadata().

In order to limit garbage, internal concrete implementations of PooledRef should directly implement PooledRefMetadata and have metadata() return a view of this.

@simonbasle
Copy link
Member Author

Originally discussed in #4 (comment),
#4 (comment) and #4 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant