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

Feature: Propagate output type into custom executor closure #3

Open
jlizen opened this issue Dec 24, 2024 · 0 comments
Open

Feature: Propagate output type into custom executor closure #3

jlizen opened this issue Dec 24, 2024 · 0 comments

Comments

@jlizen
Copy link
Owner

jlizen commented Dec 24, 2024

Right now we type erase the input and output future that we send to our custom executor closure by wrapping everything in a cancellable oneshot channel.

This is the simplest API for callers and generally a reasonable default. But, there are use cases that might benefit from preserving some type information.

For instance: Perhaps there are multiple future types, and some should be weighted heavier for acquiring concurrency permits.

One initial thought is, expose a Any<PhantomData<T>> input into the closure, where T is the output type of the input future. Maybe via an alternate setting of the existing executor.

There might also be benefit in another 'turnkey' strategy that allows selecting between multiple other strategies based on input future type, rather than requiring the full fledged custom executor?

@jlizen jlizen changed the title Feature: Propagate future output type into custom executor Feature: Propagate future output type into custom executor closure Dec 24, 2024
@jlizen jlizen changed the title Feature: Propagate future output type into custom executor closure Feature: Propagate output type into custom executor closure Dec 26, 2024
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

1 participant