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

we need something like const_eval_select for async-ness and probably for most other kinds of keyword generic #11

Closed
programmerjake opened this issue Feb 13, 2023 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@programmerjake
Copy link
Member

Motivation

Inspired by this Zulip thread

Some code needs to do completely different things for async vs. non-async versions (e.g. handling timeouts, calling OS functions, etc.), so we need some way of making those functions easy to use from callers that are generic over async-ness.

Similar reasoning applies for most other keyword-generics.

Details

I think we need something like const_eval_select for async-ness and probably for most other keyword-generic kinds.

maybe the API for async-ness could be like:

pub ~async fn asyncness_select<I, R, F: IntoFuture<Output = R>, A: FnOnce(I) -> F, S: FnOnce(I) -> R>(async_fn: A, sync_fn: S, input: I) -> R;
@yoshuawuyts
Copy link
Member

This seems like a duplicate of #6. Closing in favor of that issue.

@yoshuawuyts yoshuawuyts added the duplicate This issue or pull request already exists label Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants