Skip to content

Implement fan out request in the new mail API #2100

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Conversation

riemass
Copy link
Member

@riemass riemass commented Jun 25, 2025

WIP

@riemass riemass changed the base branch from release/2 to main July 22, 2025 06:42
Copy link

codecov bot commented Jul 22, 2025

Codecov Report

❌ Patch coverage is 92.10526% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.82%. Comparing base (f145726) to head (c7432b1).

Files with missing lines Patch % Lines
libcaf_core/caf/event_based_mail.hpp 72.72% 5 Missing and 1 partial ⚠️
...f_core/caf/event_based_fan_out_response_handle.hpp 97.50% 2 Missing ⚠️
libcaf_core/caf/policy/select_all.hpp 91.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2100      +/-   ##
==========================================
+ Coverage   72.72%   72.82%   +0.09%     
==========================================
  Files         634      635       +1     
  Lines       30365    30477     +112     
  Branches     3279     3285       +6     
==========================================
+ Hits        22084    22194     +110     
- Misses       6380     6385       +5     
+ Partials     1901     1898       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@riemass riemass requested a review from Copilot July 22, 2025 14:17
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.

Pull Request Overview

This PR implements a fan-out request feature for the CAF (C++ Actor Framework) mail API, allowing actors to send concurrent requests to multiple destinations and collect their responses according to different selection policies (select_all or select_any).

  • Adds event_based_fan_out_response_handle class to manage responses from multiple actors
  • Implements fan_out_request() method in the mail API with configurable selection policies
  • Provides comprehensive test coverage for both result-returning and void functions with different policies

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
libcaf_core/caf/fwd.hpp Adds forward declaration for the new fan-out response handle template
libcaf_core/caf/event_based_response_handle.hpp Removes unused helper structs that were likely moved elsewhere
libcaf_core/caf/event_based_mail.test.cpp Adds extensive test cases for fan-out requests with different policies and scenarios
libcaf_core/caf/event_based_mail.hpp Implements the fan_out_request() method with policy-based response aggregation
libcaf_core/caf/event_based_fan_out_response_handle.hpp Complete implementation of the fan-out response handle with policy support
libcaf_core/caf/abstract_scheduled_actor.hpp Adds friend declaration for the new fan-out response handle class
Comments suppressed due to low confidence (5)

libcaf_core/caf/event_based_fan_out_response_handle.hpp:27

  • The namespace 'detail1' is unclear and inconsistent with the existing 'detail' namespace used elsewhere in the codebase. Consider using 'detail::fan_out' or merging with the existing 'detail' namespace.
namespace caf::detail1 {

libcaf_core/caf/event_based_fan_out_response_handle.hpp:108

  • The struct name 'select_select_all_helper' has a redundant 'select' prefix. Consider renaming to 'select_all_helper_selector' or similar.
struct select_select_all_helper;

libcaf_core/caf/event_based_mail.test.cpp:689

  • Large block of commented-out test code (lines 689-772) should either be implemented, removed, or converted to a proper TODO with explanation of why it's disabled.
// TEST("send fan_out_request messages that return a composite result") {

@riemass riemass force-pushed the issue/2009 branch 2 times, most recently from 97b8acb to a5af0ea Compare July 28, 2025 09:09
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