Skip to content

[Rust][Connector] Adding status reporters and if_modified pattern #997

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

RLeclair
Copy link
Member

This PR:

  • Introduces the *_if_modified pattern that enables conditional status reporting by calling a user-provided closure with current status, only performing network operations when the closure returns Some(new_status), optimizing performance by avoiding unnecessary API calls when status hasn't changed
  • Adds DeviceEndpointStatusReporter, a clonable struct obtained from the DeviceEndpointClient that can report the status of both the device and the endpoint via report_device_status_if_modified and report_endpoint_status_if_modified
  • Adds AssetStatusReporter, a clonable struct obtained from the AssetClient that can report the status of both the device and the endpoint via report_device_status_if_modified and report_endpoint_status_if_modified
  • Adds DataOperationStatusReporter, a clonable struct obtained from the DataOperationClient that can report the status of both the device and the endpoint via report_status_if_modified
  • Removes all previous status reporting functions on the asset structs in favor of the new status reporter.
  • All status reporters can be obtained via get_status_reporter
  • Introduces report_message_schema_reference_if_modified and report_message_schema_if_modified which differ from the status reporting by providing the current message schema reference.
  • Updates the base_connector_sample for testing new *if_modified functionality and associated CRDs

@Copilot Copilot AI review requested due to automatic review settings August 23, 2025 00:53
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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