Skip to content

feat: verify to support Cache Flush on Failure Indication - #267

Merged
keepsimple1 merged 9 commits into
mainfrom
verify
Nov 17, 2024
Merged

keepsimple1 merged 9 commits into
mainfrom
verify

Conversation

@keepsimple1

@keepsimple1 keepsimple1 commented Nov 9, 2024 •

Copy link
Copy Markdown
Owner

This patch is to resolve issue #54 by implement a function to support Cache Flush on Failure Indication

A new API of ServiceDaemon is added:

    pub fn verify_resource(&self, resource: DnsResource, timeout: Duration) -> Result<()>

The idea is that, a querier can call this API anytime to verify if the service records still valid. A ServiceRemoved event will be triggered if no response in timeout.

DnsResource supports SRV record and ADDR record at this moment.

For convenience, VERIFY_RESOURCE_TIMEOUT_DEFAULT is defined for timeout.

UPDATE:

I simplified the new API based on this thought: (most) users would not make 2 calls to verify service_instance_name and hostname for one service instance. The user should be able to call just once to verify a service instance. The library will send query for both SRV and ADDR records internally.

The API now is this:

    pub fn verify(&self, instance_fullname: String, timeout: Duration) -> Result<()> 

@keepsimple1 keepsimple1 changed the title feat: verify_resource to support Cache Flush on Failure Indication feat: verify to support Cache Flush on Failure Indication Nov 9, 2024
@keepsimple1
keepsimple1 merged commit 1ade666 into main Nov 17, 2024
@keepsimple1
keepsimple1 deleted the verify branch November 17, 2024 06:54
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

Successfully merging this pull request may close these issues.

1 participant