feature(discover): trigger debounced discovery on consul config change #35
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Anthony Casagrande anthony.j.casagrande@intel.com
PR Checklist
Please check if your PR fulfills the following requirements:
Issue Number:
#31
What is the new behavior?
Whenever a change to
DiscoverySubnets
orScanPort
is detected via a Consul watcher,a discovery is automatically triggered after a 10-second de-bounced delay.
Does this PR introduce a breaking change?
New Imports
Other information
Right now this makes a call directly to the
ProtocolDiscovery
interface'sDiscover()
function. One potential issue is that this bypasses the internal EdgeX mutex locking around being called multiple times. Because that code is internal to the SDK, there is no way to call it directly.The alternative is to make a REST call to the
/discovery
endpoint, but I felt that was not a great solution especially considering the url and port to make the call against are not readily available information. Best case would probably be having the SDK add a public wrapper around triggering a discovery.