-
Notifications
You must be signed in to change notification settings - Fork 122
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
creates an abstract RefreshableServiceProviderPlace for config reloading #1035
base: main
Are you sure you want to change the base?
creates an abstract RefreshableServiceProviderPlace for config reloading #1035
Conversation
😍 |
* | ||
* @throws IOException if there is an issue loading the config | ||
*/ | ||
protected void refresh() throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It occurs to me that this might not be safe to call while the place is actively processing an IBDO, or while trying to identify the next place that should process a payload.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a good approach. Minor changes suggested
return this.invalid.get(); | ||
} | ||
|
||
public void invalidate() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Might want to add a Javadoc comment stating that
invalidate
must be called before callingrefresh
. - Might want to mark this method as
final
and do the same to therefresh
overloads
} | ||
|
||
@Test | ||
void testReconfigure() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding another test (or block within this test) that calls place.refresh()
without first calling invalidate()
import javax.annotation.Nullable; | ||
|
||
/** | ||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* | |
* ServiceProviderPlace that supports on-demand refresh of its configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. The only potential change I see might be to also mark the new isValid()
and setInvalid()
methods as final
a5e8bc2
to
40e4ccb
Compare
Sorry, the directory place change doesn't need to go out with this round of changes. |
This is a first cut into handling place config refreshing -- this does not handle service key changes at this time