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

Add iterator access for entries #645

Merged

Conversation

argerus
Copy link
Contributor

@argerus argerus commented Sep 4, 2023

A wrapper function that made it easy to iterate through metadata was already available in the broker interface:

broker
    .map_metadata(|metadata| proto::Metadata::from(metadata))
    .await

This has been generalized to iterate over entries instead (i.e. not only metadata) as that will be useful when in the kuksa.val.v1 interface for example:

broker
    .map_entries(|entry| {
        // Extract stuff from all entries (including metadata)
    }).await

broker
    .filter_map_entries(|entry| {
        // Extract stuff from some entries (including metadata)
    }).await

Copy link
Contributor

@lukasmittag lukasmittag left a comment

Choose a reason for hiding this comment

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

LGTM just one question. Will filter_map_entries get used cause currently I see not how it gets used. And just to confirm the adaptions get only used in grpc/sdv_databroker_v1 because in the grpc/kuksa_val_v1 the feature is not implemented yet - am I right?

@argerus
Copy link
Contributor Author

argerus commented Sep 6, 2023

LGTM just one question. Will filter_map_entries get used cause currently I see not how it gets used. And just to confirm the adaptions get only used in grpc/sdv_databroker_v1 because in the grpc/kuksa_val_v1 the feature is not implemented yet - am I right?

Correct (on both counts). The reason for adding it (filter_map_entries etc) is that it would have made #641 and similar functionality easier to implement. That PR is already merged, and added very interface specific code to broker.rs. That code can be moved out to live along the rest of the interface specific code when this PR is merged.

@argerus argerus merged commit fed6a1d into eclipse:master Sep 6, 2023
10 checks passed
@erikbosch erikbosch deleted the feature/databroker_iter_entries branch October 31, 2024 12:56
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.

2 participants