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

Refactor: Unified Cache Design #416

Open
you-n-g opened this issue Oct 9, 2024 · 0 comments
Open

Refactor: Unified Cache Design #416

you-n-g opened this issue Oct 9, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@you-n-g
Copy link
Contributor

you-n-g commented Oct 9, 2024

🌟 Feature Description

Simplify Cache Design

Motivation

Currently, RD-Agent has a lot of repeatitive cache implementation(e.g. #415)
We can have a shared cache implement and provide a design that will not affect the readability of the main code.

  • The shared cache design including:
    • storage
    • handling multi-processing
    • key getter function
    • cache invalidation machenism
    • ....

Here are some example:

Example1...

Code without cache

def f(...):
   ...

Code with cache.

@cache(key=a_func_to_gen_cache_key, drop_cache_mechanism=...)
def f(...):
   ...

Example2...

Code without cache

<a block of code>

Code with cache.

@cache(...)
def _f(...)
    <a block of code>
    return ...
_f(...)
@you-n-g you-n-g added the enhancement New feature or request label Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant