question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SmartCache Wrapper Component

See original GitHub issue

Is your feature request related to a problem? Please describe. To leverage SmartCache, what user need to do is simply wrap a Dataset with SmartCacheDataset as below. However, it is a repeating task for any Dataset in the exact same way.

class SmartCacheMyDataset(SmartCacheDataset):
    """
    Add SmartCache functionality to MyDataset
    """
    def __init__(
        self,
        data,
        other_parameters,
        transform,
        replace_rate,
        cache_num,
        cache_rate,
        num_init_workers,
        num_replace_workers,
    ):
        extractor = MyDataset(data, other_parameters)
        super().__init__(
            data=extractor,
            transform=transform,
            replace_rate=replace_rate,
            cache_num=cache_num,
            cache_rate=cache_rate,
            num_init_workers=num_init_workers,
            num_replace_workers=num_replace_workers,
        )

Describe the solution you’d like It would be nice to have SmartCache wrapper (as a handler, transformer, or anything else) that can be added into the pipeline to leverage SmartCache functionality without the need to write a new dataset. In this way, SmartCache can be turned on and off by just adding or removing this component without changing any other part of the code.

I think the wrapper itself is easy and don’t have much more than what I described above but the only challenge is that it should be called either before DataLoader or inside it.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Nic-Macommented, Mar 29, 2021

Hi @behxyz ,

Already added to our internal Clara roadmap.

Thanks.

1reaction
drbehcommented, Mar 29, 2021

Hi @Nic-Ma , I agree, it would be great if we can add this feature request to the Clara Train roadmap.

Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

https://www.drupal.org/files/issues/smartcache-242...
'html' || $event->getRequest()->query->has(MainContentViewSubscriber::WRAPPER_FORMAT)) { + return; + } + + // @todo For now, SmartCache doesn't handle admin ...
Read more >
C#: How to implement a smart cache
I'm imagining if what is cached are larger values and if the application is a long-running one, this might end up as kind...
Read more >
Dell PowerScale OneFS SmartFlash
knowledge of the OneFS components, architecture, commands, and features. This paper presents information for deploying and managing a Dell ...
Read more >
EchoX3 is a distributed object cache that allows methods to ...
For example, the SmartCache exposes a plain cache interface. The implementation details are hidden from the clients. The wrapper takes in requests and ......
Read more >
User-oriented smart-cache for the Web: What You Seek is ...
User-oriented smart-cache for the Web: ... providing a query language (wrapper), as well as poorly ... component in order to retrieve data from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found