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 WhenAll with output order same as input order #221

Merged
merged 6 commits into from
Oct 31, 2022
Merged

Conversation

MBkkt
Copy link
Member

@MBkkt MBkkt commented Oct 30, 2022

Purpose

ArangoDB needs it, I can use coroutine but need smaller diff

Related Information

  • Design document: ...
  • Bench PR: ...

Testing

  • This change is a trivial rework or code cleanup without any test coverage.
  • This change is already covered by existing tests.
  • This PR adds tests that were used to verify all changes.
  • There are tests in an external testing repository: ...

@MBkkt MBkkt added the enhancement New feature label Oct 30, 2022
@MBkkt MBkkt requested a review from kononovk as a code owner October 30, 2022 22:30
using R = std::conditional_t<P == WhenPolicy::None, Result<V, E>, V>;
auto [future_core, combinator] = detail::AllCombinator<R, E>::Make(count);
detail::WhenImpl(combinator, begin, count);
using R = std::conditional_t<F == FailPolicy::None, Result<V, E>, V>;
Copy link
Member Author

Choose a reason for hiding this comment

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

In general no difference between Fifo and Same if R is void.
So I think it always should be Fifo policy, and Same AllCombinator shouldn't work with void

Comment on lines +12 to +14
void AddInput(BaseCore* core) noexcept {
core->SetInline(*this);
}
Copy link
Member Author

Choose a reason for hiding this comment

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

not null => &
ResultCore<V, E>? to avoid cast
always inline?

@coveralls
Copy link

coveralls commented Oct 30, 2022

Pull Request Test Coverage Report for Build 3357611113

  • 80 of 80 (100.0%) changed or added relevant lines in 11 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 3308346375: 0.0%
Covered Lines: 1414
Relevant Lines: 1414

💛 - Coveralls

@codecov
Copy link

codecov bot commented Oct 30, 2022

Codecov Report

Merging #221 (7329db7) into main (a5862ec) will decrease coverage by 0.07%.
The diff coverage is 98.75%.

❗ Current head 7329db7 differs from pull request most recent head 0ada9ba. Consider uploading reports for the commit 0ada9ba to get more accurate results

@@             Coverage Diff             @@
##              main     #221      +/-   ##
===========================================
- Coverage   100.00%   99.92%   -0.08%     
===========================================
  Files           62       63       +1     
  Lines         1369     1414      +45     
===========================================
+ Hits          1369     1413      +44     
- Misses           0        1       +1     
Impacted Files Coverage Δ
include/yaclib/algo/detail/wait_event.hpp 100.00% <ø> (ø)
include/yaclib/async/detail/when_any_impl.hpp 100.00% <ø> (ø)
include/yaclib/coro/await.hpp 100.00% <ø> (ø)
src/algo/result_core.cpp 100.00% <ø> (ø)
include/yaclib/async/detail/when_all_impl.hpp 99.00% <98.18%> (-1.00%) ⬇️
include/yaclib/algo/detail/core.hpp 100.00% <100.00%> (ø)
include/yaclib/algo/detail/inline_core.hpp 100.00% <100.00%> (ø)
include/yaclib/algo/detail/result_core.hpp 100.00% <100.00%> (ø)
include/yaclib/algo/wait_group.hpp 100.00% <100.00%> (ø)
include/yaclib/async/detail/when_impl.hpp 100.00% <100.00%> (ø)
... and 5 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@MBkkt MBkkt assigned MBkkt and unassigned MBkkt Oct 30, 2022
@MBkkt MBkkt merged commit e1da1bc into main Oct 31, 2022
@MBkkt MBkkt deleted the mbkkt/when_all2 branch November 15, 2022 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants