Skip to content

dcache consume api rework - #151

Merged
niki4smirn merged 1 commit into
mainfrom
nik/dcache-api-fix
Sep 4, 2026
Merged

dcache consume api rework#151
niki4smirn merged 1 commit into
mainfrom
nik/dcache-api-fix

Conversation

@niki4smirn

@niki4smirn niki4smirn commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Before

adapter.consume_with_dcache(
    |msg, bytes| parse_payload(msg, bytes),
    |result, producers| match result {
        DCacheRead::Ok((msg, payload)) => {
            handle_message(msg, Some(payload), producers);
        }
        DCacheRead::NoRef(msg) | DCacheRead::Lost(msg) => {
            handle_message(msg, None, producers);
        }
        DCacheRead::SpedPast => {
            // What should I do with that?
        }
        DCacheRead::Empty => {}
    },
);

After

adapter.consume_with_dcache(
    |msg, bytes| parse_payload(msg, bytes),
    |msg, payload, producers| {
        handle_message(msg, payload, producers);
    },
);

tldr
DCacheRead::Empty => closure not called
DCacheRead::SpedPast => safe_assert, closure not called
DCacheRead::Lost => safe_assert, closure not called
DCacheRead::NoRef(msg) => payload is None
DCacheRead::Ok((msg, payload)) => payload is Some

@niki4smirn
niki4smirn requested a review from a team September 4, 2026 13:30
@niki4smirn
niki4smirn marked this pull request as draft September 4, 2026 13:36
@niki4smirn
niki4smirn marked this pull request as ready for review September 4, 2026 13:44
@niki4smirn
niki4smirn merged commit e188055 into main Sep 4, 2026
3 checks passed
@niki4smirn
niki4smirn deleted the nik/dcache-api-fix branch September 4, 2026 14:35
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