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

Add Async Method Support to ICache Interface #2095

Open
petriceko opened this issue Sep 23, 2024 · 7 comments · May be fixed by #2096
Open

Add Async Method Support to ICache Interface #2095

petriceko opened this issue Sep 23, 2024 · 7 comments · May be fixed by #2096

Comments

@petriceko
Copy link

While implementing a custom ICache interface for use with Piranha, I noticed that the current ICache interface lacks support for asynchronous methods. Adding async support would be highly beneficial, especially for scenarios involving remote caches or databases, where non-blocking operations are crucial for maintaining performance and scalability.

Proposal:

I propose adding the following async methods to the ICache interface:

Task<T?> GetAsync<T>(string key, CancellationToken cancellationToken = default);
Task SetAsync<T>(string key, T value, CancellationToken cancellationToken = default);
Task RemoveAsync(string key, CancellationToken cancellationToken = default);

These methods would complement the existing synchronous methods, providing a non-blocking alternative for consumers.

@tidyui
Copy link
Member

tidyui commented Sep 23, 2024

As this is a breaking change this will be scheduled for the next major release.

@Vilemcok
Copy link

Hello, I also need this change. @tidyui are you able to specify when is going to be next release?

@vikrantingole
Copy link

Hello, I also expect this proposal ASAP. Please help.

@tidyui
Copy link
Member

tidyui commented Sep 24, 2024

It all depends on implementation. I have an idea how it could be implemented in a non breaking manner which would mean it could be released sooner.

@gasperini
Copy link

It would be really helpful to have this improvement as soon as possible.

@peterlacko
Copy link

Hello, I also need this to be implemented due to performance issues in our app, thanks.

@Vito2502
Copy link

Hi @tidyui keep me updated if you can on this fix because it is important for my project.
I would like to understand when the release containing this fix could be released.

@tidyui tidyui moved this to Todo in Version 12.0 Nov 20, 2024
@tidyui tidyui linked a pull request Nov 20, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

7 participants