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

optimize lazy collectAll implement #125

Open
2 tasks
RainMark opened this issue Jul 6, 2022 · 5 comments
Open
2 tasks

optimize lazy collectAll implement #125

RainMark opened this issue Jul 6, 2022 · 5 comments

Comments

@RainMark
Copy link
Collaborator

RainMark commented Jul 6, 2022

Search before asking

  • I searched the issues and found no similar issues.

What happened + What you expected to happen

detail::CollectAnyAwaiter<LazyType<T>, IAlloc>>;

Lazy<> foo() {}

collectAll(foo().via(executor)) is equal to collectAllPara(foo())

maybe we can use collectAll(foo().via(executor)) to simplify the collectAllPara, for example: collectAllPara call collectAll(foo().via(executor)) directly

Reproduction way

Anything else

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!
@ChuanqiXu9
Copy link
Collaborator

What if the lazy don't contain an Executor when we call collectAllPara(foo())?

@RainMark
Copy link
Collaborator Author

RainMark commented Jul 7, 2022

What if the lazy don't contain an Executor when we call collectAllPara(foo())?

collectAllPara can not run sub coroutines in parallel without executor

@ChuanqiXu9
Copy link
Collaborator

Another problem is that collectAllPara is not equal to collectAll, it might be design mistake. We may need to change it.

@RainMark
Copy link
Collaborator Author

RainMark commented Jul 7, 2022

Another problem is that collectAllPara is not equal to collectAll, it might be design mistake. We may need to change it.

em,we can remove

using AT = std::conditional_t<
        std::is_same_v<LazyType<T>, Lazy<T>>,
        detail::SimpleCollectAllAwaitable<T, IAlloc, OAlloc, Para>,
        detail::CollectAllAwaiter<LazyType<T>, IAlloc, OAlloc, Para>>;

@ChuanqiXu9
Copy link
Collaborator

Another problem is that collectAllPara is not equal to collectAll, it might be design mistake. We may need to change it.

em,we can remove

using AT = std::conditional_t<
        std::is_same_v<LazyType<T>, Lazy<T>>,
        detail::SimpleCollectAllAwaitable<T, IAlloc, OAlloc, Para>,
        detail::CollectAllAwaiter<LazyType<T>, IAlloc, OAlloc, Para>>;

Maybe we need to do more work on the interface. The previous design looks not good.

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

No branches or pull requests

2 participants