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

Asyncify filesystem cache #4345

Merged
merged 7 commits into from
Jan 3, 2024
Merged

Asyncify filesystem cache #4345

merged 7 commits into from
Jan 3, 2024

Conversation

maminrayej
Copy link
Contributor

In the middle of my investigations for improving startup time, I encountered issue #3851 in one of the comments.
This fix isn't ideal since it uses the tokio thread pool instead of the pool in TokioTaskManager. I couldn't figure out how to design a trait that is both object-safe, and is able to model the spawn_await function that I had in mind properly. This is the best that I came up with:

pub trait AsyncTaskManager {
    type Future<T>: Future<Output = T>;
    
    fn spawn_await<T>(&self, f: impl Future<Output = T>) -> Self::Future<T>;
}

which isn't object-safe.

I could clone the TokioTaskManager directly into FileSystemCache, but I was not sure about it.

@maminrayej
Copy link
Contributor Author

@Michael-F-Bryan are there any blockers for this PR?

Copy link
Contributor

@Michael-F-Bryan Michael-F-Bryan left a comment

Choose a reason for hiding this comment

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

Let's merge this! 🚀

@maminrayej maminrayej force-pushed the asyncify-filesystem-cache branch from 3e93a25 to cb41ae1 Compare January 3, 2024 09:48
@maminrayej maminrayej merged commit 09ee6eb into master Jan 3, 2024
51 of 52 checks passed
@maminrayej maminrayej deleted the asyncify-filesystem-cache branch January 3, 2024 12:01
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

Successfully merging this pull request may close these issues.

2 participants