Skip to content

Implement on_result execution adaptor #345

Description

@rrahn

Can be put probably under core/algorithm/execution/

Required by #344

From the current design this could be the simplest implmentation to allow asynchron execution for the algorithms. One could outsource this into a separate data structure to reuse it for alignment and search.

Note this is based on changes made in #1854:

auto algo(range r, config)
{
    ...
    auto algorithm = configure(config);
    ...
    constexpr bool requires_one_way_execution = config::exists<algo_config::on_result>();
    if constexpr (!requires_one_way_execution)
    {  // Current behavior
        return range{algorithm_executor_blocking{...}};
    }
    else
    { // New behavior
       auto executor = select_execution_handler();
       executor.bulk_execute(algorithm, r, user_callback); // implicit wait :)
       //for (auto && elem : r)
       //    executor.execute(algorithm, elem, user_callback);

       // exector.wait();
    }
}

Metadata

Metadata

Assignees

Labels

feature/proposala new feature or an idea ofready to tackleFully specified, discussed and understood. Can be tackled.release noteFeatures or bugs that should be presented on the release note.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions