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

Support for coroutines (asyncio) #27

Open
dekked opened this issue May 9, 2020 · 3 comments
Open

Support for coroutines (asyncio) #27

dekked opened this issue May 9, 2020 · 3 comments

Comments

@dekked
Copy link

dekked commented May 9, 2020

Hello,

I was trying to use cachier for caching the result of functions, in particular, HTTP requests.

I am using asyncio throughout my code. I noticed that cachier is fully synchronous, as seen here when calling _calc_entry.

It would be great to have support for caching result of coroutines, using await.

Maybe an async PickeCore / decorator? I am not clear on the best way to accomplish this with minimal code duplication, though.

@shaypal5
Copy link
Collaborator

Hey,

That's an interesting use case. Yeah, I'm not sure myself. I think duplicating the decorator in a way that is agnostic to the core being used would be best, but this might also require rewriting the cores themselves to some extent. Also, it might simply be too complicated or plain impossible to have cores support this agnostically, and so each core would perhaps have to have a separate async implementation. But the pickle one is the important one anyway, I think.

I guess you'd have to figure things out a bit more before I can help you with this, as I really don't have the time to dive into this problem myself.

@Paillat-dev
Copy link

This would be amazing

@bswck
Copy link

bswck commented Jul 27, 2024

Bump on that one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants