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

Clarify lifecycle of Constraint#predicate Predicate #7620

Open
findepi opened this issue Apr 16, 2021 · 2 comments
Open

Clarify lifecycle of Constraint#predicate Predicate #7620

findepi opened this issue Apr 16, 2021 · 2 comments

Comments

@findepi
Copy link
Member

findepi commented Apr 16, 2021

Constraint#predicate is an opaque Predicate that internally holds to an evaluator.
this is passed to ConnectorMetadata#applyFilter

Question:

  • is connector allowed to hold onto this predicate after ConnectorMetadata#applyFilter returns?

Regardless of the answer, since this is a subtle aspect of the SPI, we should document that in the javadoc.

@martint
Copy link
Member

martint commented Apr 16, 2021

No, it's not allowed to hold on to it. It's meant to be used only for the duration of the API call.

@findepi
Copy link
Member Author

findepi commented Apr 16, 2021

That would be my intuition as well, but i didn't know the intentions.

  1. we should document
  2. we can optionally enforce that, by "destroying" the evaluator after the call returns

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

No branches or pull requests

2 participants